[PATCH] localrepo: provide progress updates during commit

David Golub golubdr at gmail.com
Sun Nov 13 10:19:07 CST 2011


# HG changeset patch
# User David Golub <golubdr at gmail.com>
# Date 1321151484 18000
# Branch stable
# Node ID ea3de4de1f99d7038d2116c81f849b4e1136e35b
# Parent  f8a0c79254965fd34eb9cbe82387115c5d7d7a59
localrepo: provide progress updates during commit

diff -r f8a0c7925496 -r ea3de4de1f99 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu Nov 10 17:06:12 2011 -0600
+++ b/mercurial/localrepo.py	Sat Nov 12 21:31:24 2011 -0500
@@ -1168,7 +1168,9 @@
                 new = {}
                 changed = []
                 linkrev = len(self)
-                for f in sorted(ctx.modified() + ctx.added()):
+                total = len(ctx.modified() + ctx.added())
+                for i, f in enumerate(sorted(ctx.modified() + ctx.added())):
+                    self.ui.progress(_('committing'), i, total=total, unit=_('files'))
                     self.ui.note(f + "\n")
                     try:
                         fctx = ctx[f]
@@ -1185,6 +1187,7 @@
                             raise
                         else:
                             removed.append(f)
+                self.ui.progress(_('committing'), None)
 
                 # update manifest
                 m1.update(new)


More information about the Mercurial-devel mailing list