changeset 29872:58db005d870e

rebase: properly calculate total commits to rebase (issue5347) Before this, predecessor commits were being included in the count
author timeless <timeless@mozdev.org>
date Fri, 26 Aug 2016 00:16:51 +0000
parents 90af59b40d8a
children 80ba176bad62
files hgext/rebase.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Sun Aug 28 17:51:32 2016 -0700
+++ b/hgext/rebase.py	Fri Aug 26 00:16:51 2016 +0000
@@ -336,7 +336,8 @@
             bookmarks.deactivate(repo)
 
         sortedrevs = sorted(self.state)
-        total = len(self.state)
+        cands = [k for k, v in self.state.iteritems() if v == revtodo]
+        total = len(cands)
         pos = 0
         for rev in sortedrevs:
             ctx = repo[rev]
@@ -345,8 +346,8 @@
             names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node())
             if names:
                 desc += ' (%s)' % ' '.join(names)
-            pos += 1
             if self.state[rev] == revtodo:
+                pos += 1
                 ui.status(_('rebasing %s\n') % desc)
                 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, ctx)),
                             _('changesets'), total)