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