##// END OF EJS Templates
progress: hide update(None) in a new complete() method...
Martin von Zweigbergk -
r38392:ef692614 default
parent child Browse files
Show More
@@ -246,7 +246,7 b' class cg1unpacker(object):'
246 self.manifestheader()
246 self.manifestheader()
247 deltas = self.deltaiter()
247 deltas = self.deltaiter()
248 repo.manifestlog._revlog.addgroup(deltas, revmap, trp)
248 repo.manifestlog._revlog.addgroup(deltas, revmap, trp)
249 prog.update(None)
249 prog.complete()
250 self.callback = None
250 self.callback = None
251
251
252 def apply(self, repo, tr, srctype, url, targetphase=phases.draft,
252 def apply(self, repo, tr, srctype, url, targetphase=phases.draft,
@@ -309,7 +309,7 b' class cg1unpacker(object):'
309 config='warn-empty-changegroup')
309 config='warn-empty-changegroup')
310 clend = len(cl)
310 clend = len(cl)
311 changesets = clend - clstart
311 changesets = clend - clstart
312 progress.update(None)
312 progress.complete()
313 self.callback = None
313 self.callback = None
314
314
315 # pull off the manifest group
315 # pull off the manifest group
@@ -2195,7 +2195,7 b' def remove(ui, repo, m, prefix, after, f'
2195 except error.LookupError:
2195 except error.LookupError:
2196 warnings.append(_("skipping missing subrepository: %s\n")
2196 warnings.append(_("skipping missing subrepository: %s\n")
2197 % join(subpath))
2197 % join(subpath))
2198 progress.update(None)
2198 progress.complete()
2199
2199
2200 # warn about failure to delete explicit files/dirs
2200 # warn about failure to delete explicit files/dirs
2201 deleteddirs = util.dirs(deleted)
2201 deleteddirs = util.dirs(deleted)
@@ -2224,7 +2224,7 b' def remove(ui, repo, m, prefix, after, f'
2224 % m.rel(f))
2224 % m.rel(f))
2225 # missing files will generate a warning elsewhere
2225 # missing files will generate a warning elsewhere
2226 ret = 1
2226 ret = 1
2227 progress.update(None)
2227 progress.complete()
2228
2228
2229 if force:
2229 if force:
2230 list = modified + deleted + clean + added
2230 list = modified + deleted + clean + added
@@ -2239,7 +2239,7 b' def remove(ui, repo, m, prefix, after, f'
2239 warnings.append(_('not removing %s: file still exists\n')
2239 warnings.append(_('not removing %s: file still exists\n')
2240 % m.rel(f))
2240 % m.rel(f))
2241 ret = 1
2241 ret = 1
2242 progress.update(None)
2242 progress.complete()
2243 else:
2243 else:
2244 list = deleted + clean
2244 list = deleted + clean
2245 progress = ui.makeprogress(_('skipping'),
2245 progress = ui.makeprogress(_('skipping'),
@@ -2255,7 +2255,7 b' def remove(ui, repo, m, prefix, after, f'
2255 warnings.append(_("not removing %s: file has been marked for add"
2255 warnings.append(_("not removing %s: file has been marked for add"
2256 " (use 'hg forget' to undo add)\n") % m.rel(f))
2256 " (use 'hg forget' to undo add)\n") % m.rel(f))
2257 ret = 1
2257 ret = 1
2258 progress.update(None)
2258 progress.complete()
2259
2259
2260 list = sorted(list)
2260 list = sorted(list)
2261 progress = ui.makeprogress(_('deleting'), total=len(list),
2261 progress = ui.makeprogress(_('deleting'), total=len(list),
@@ -2264,7 +2264,7 b' def remove(ui, repo, m, prefix, after, f'
2264 if ui.verbose or not m.exact(f):
2264 if ui.verbose or not m.exact(f):
2265 progress.increment()
2265 progress.increment()
2266 ui.status(_('removing %s\n') % m.rel(f))
2266 ui.status(_('removing %s\n') % m.rel(f))
2267 progress.update(None)
2267 progress.complete()
2268
2268
2269 if not dryrun:
2269 if not dryrun:
2270 with repo.wlock():
2270 with repo.wlock():
@@ -1785,7 +1785,7 b' def applyupdates(repo, actions, wctx, mc'
1785 actions[ACTION_MERGE] = [a for a in actions[ACTION_MERGE]
1785 actions[ACTION_MERGE] = [a for a in actions[ACTION_MERGE]
1786 if a[0] in mfiles]
1786 if a[0] in mfiles]
1787
1787
1788 progress.update(None)
1788 progress.complete()
1789 return updateresult(updated, merged, removed, unresolved)
1789 return updateresult(updated, merged, removed, unresolved)
1790
1790
1791 def recordupdates(repo, actions, branchmerge):
1791 def recordupdates(repo, actions, branchmerge):
@@ -1302,6 +1302,9 b' class progress(object):'
1302 def increment(self, step=1, item="", total=None):
1302 def increment(self, step=1, item="", total=None):
1303 self.update(self.pos + step, item, total)
1303 self.update(self.pos + step, item, total)
1304
1304
1305 def complete(self):
1306 self.update(None)
1307
1305 def _print(self, item):
1308 def _print(self, item):
1306 self.ui.progress(self.topic, self.pos, item, self.unit,
1309 self.ui.progress(self.topic, self.pos, item, self.unit,
1307 self.total)
1310 self.total)
@@ -252,7 +252,7 b' def findcommonheads(ui, local, remote,'
252 # return any heads in that case, so discard that
252 # return any heads in that case, so discard that
253 result.discard(nullrev)
253 result.discard(nullrev)
254 elapsed = util.timer() - start
254 elapsed = util.timer() - start
255 progress.update(None)
255 progress.complete()
256 ui.debug("%d total queries in %.4fs\n" % (roundtrips, elapsed))
256 ui.debug("%d total queries in %.4fs\n" % (roundtrips, elapsed))
257 msg = ('found %d common and %d unknown server heads,'
257 msg = ('found %d common and %d unknown server heads,'
258 ' %d roundtrips in %.4fs\n')
258 ' %d roundtrips in %.4fs\n')
@@ -44,7 +44,7 b' def _findexactmatches(repo, added, remov'
44 break
44 break
45
45
46 # Done
46 # Done
47 progress.update(None)
47 progress.complete()
48
48
49 def _ctxdata(fctx):
49 def _ctxdata(fctx):
50 # lazily load text
50 # lazily load text
@@ -321,7 +321,7 b" def generatebundlev1(repo, compression='"
321 progress.increment(step=len(chunk))
321 progress.increment(step=len(chunk))
322 yield chunk
322 yield chunk
323
323
324 progress.update(None)
324 progress.complete()
325
325
326 return requirements, gen()
326 return requirements, gen()
327
327
@@ -384,7 +384,7 b' def consumev1(repo, fp, filecount, bytec'
384 elapsed = util.timer() - start
384 elapsed = util.timer() - start
385 if elapsed <= 0:
385 if elapsed <= 0:
386 elapsed = 0.001
386 elapsed = 0.001
387 progress.update(None)
387 progress.complete()
388 repo.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
388 repo.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
389 (util.bytecount(bytecount), elapsed,
389 (util.bytecount(bytecount), elapsed,
390 util.bytecount(bytecount / elapsed)))
390 util.bytecount(bytecount / elapsed)))
@@ -526,7 +526,7 b' def _emit2(repo, entries, totalfilesize)'
526 finally:
526 finally:
527 fp.close()
527 fp.close()
528 finally:
528 finally:
529 progress.update(None)
529 progress.complete()
530
530
531 def generatev2(repo):
531 def generatev2(repo):
532 """Emit content for version 2 of a streaming clone.
532 """Emit content for version 2 of a streaming clone.
@@ -624,7 +624,7 b' def consumev2(repo, fp, filecount, files'
624 repo.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
624 repo.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
625 (util.bytecount(progress.pos), elapsed,
625 (util.bytecount(progress.pos), elapsed,
626 util.bytecount(progress.pos / elapsed)))
626 util.bytecount(progress.pos / elapsed)))
627 progress.update(None)
627 progress.complete()
628
628
629 def applybundlev2(repo, fp, filecount, filesize, requirements):
629 def applybundlev2(repo, fp, filecount, filesize, requirements):
630 missingreqs = [r for r in requirements if r not in repo.supported]
630 missingreqs = [r for r in requirements if r not in repo.supported]
General Comments 0
You need to be logged in to leave comments. Login now