rebase/progress: Adding progress for rebasing
authortimeless <timeless@gmail.com>
Tue, 20 Jul 2010 20:53:48 +0200
changeset 11729 c91b86a291b0
parent 11728 226a328a7ff3
child 11730 7469ff872122
rebase/progress: Adding progress for rebasing
hgext/rebase.py
--- a/hgext/rebase.py	Thu Jul 22 18:47:46 2010 +0300
+++ b/hgext/rebase.py	Tue Jul 20 20:53:48 2010 +0200
@@ -148,9 +148,13 @@
             targetancestors = set(repo.changelog.ancestors(target))
             targetancestors.add(target)
 
-        for rev in sorted(state):
+        sortedstate = sorted(state)
+        total = len(sortedstate)
+        pos = 0
+        for rev in sortedstate:
+            pos += 1
             if state[rev] == -1:
-                ui.debug("rebasing %d:%s\n" % (rev, repo[rev]))
+                ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])), _(' changesets'), total)
                 storestatus(repo, originalwd, target, state, collapsef, keepf,
                                                     keepbranchesf, external)
                 p1, p2 = defineparents(repo, rev, target, state,
@@ -179,6 +183,7 @@
                         skipped.add(rev)
                     state[rev] = p1
 
+        ui.progress(_('rebasing'), None)
         ui.note(_('rebase merging completed\n'))
 
         if collapsef and not keepopen: