##// END OF EJS Templates
fastannotate: process files as they arrive...
Martin von Zweigbergk -
r39751:d8a7690c default
parent child Browse files
Show More
@@ -163,23 +163,23 b' def clientfetch(repo, paths, lastnodemap'
163 163 'getannotate',
164 164 {'path': p, 'lastnode':lastnodemap.get(p)}))
165 165
166 ui.debug('fastannotate: server returned\n')
167 for result in results:
168 r = result.result()
169 # TODO: pconvert these paths on the server?
170 r = {util.pconvert(p): v for p, v in r.iteritems()}
171 for path in sorted(r):
172 # ignore malicious paths
173 if not path.startswith('fastannotate/') or '/../' in (path + '/'):
174 ui.debug('fastannotate: ignored malicious path %s\n' % path)
175 continue
176 content = r[path]
177 if ui.debugflag:
178 ui.debug('fastannotate: writing %d bytes to %s\n'
179 % (len(content), path))
180 repo.vfs.makedirs(os.path.dirname(path))
181 with repo.vfs(path, 'wb') as f:
182 f.write(content)
166 for result in results:
167 r = result.result()
168 # TODO: pconvert these paths on the server?
169 r = {util.pconvert(p): v for p, v in r.iteritems()}
170 for path in sorted(r):
171 # ignore malicious paths
172 if (not path.startswith('fastannotate/')
173 or '/../' in (path + '/')):
174 ui.debug('fastannotate: ignored malicious path %s\n' % path)
175 continue
176 content = r[path]
177 if ui.debugflag:
178 ui.debug('fastannotate: writing %d bytes to %s\n'
179 % (len(content), path))
180 repo.vfs.makedirs(os.path.dirname(path))
181 with repo.vfs(path, 'wb') as f:
182 f.write(content)
183 183
184 184 def _filterfetchpaths(repo, paths):
185 185 """return a subset of paths whose history is long and need to fetch linelog
@@ -47,7 +47,6 b' setup the local repo'
47 47 sending protocaps command
48 48 fastannotate: requesting 1 files
49 49 sending getannotate command
50 fastannotate: server returned
51 50 fastannotate: writing 112 bytes to fastannotate/default/a.l
52 51 fastannotate: writing 94 bytes to fastannotate/default/a.m
53 52 fastannotate: a: using fast path (resolved fctx: True)
@@ -94,7 +93,6 b' client can also build things up on its o'
94 93 sending protocaps command
95 94 fastannotate: requesting 1 files
96 95 sending getannotate command
97 fastannotate: server returned
98 96 fastannotate: a: 1 new changesets in the main branch
99 97 0: 1
100 98 1: 2
@@ -142,7 +140,6 b' in the "fctx" mode, the client could als'
142 140
143 141 $ hg annotate a --config fastannotate.modes=fctx --debug --config fastannotate.mainbranch=4 | grep fastannotate
144 142 fastannotate: requesting 1 files
145 fastannotate: server returned
146 143 fastannotate: a: 1 new changesets in the main branch
147 144
148 145 the server would rebuild broken cache automatically
@@ -171,7 +168,6 b' use the "debugbuildannotatecache" comman'
171 168 sending protocaps command
172 169 fastannotate: requesting 1 files
173 170 sending getannotate command
174 fastannotate: server returned
175 171 fastannotate: writing * (glob)
176 172 fastannotate: writing * (glob)
177 173 $ diff $p1/a.l $p2/a.l
General Comments 0
You need to be logged in to leave comments. Login now