Patchwork D23: rebase: move obsoleted not rebased messages earlier (BC)

login
register
mail settings
Submitter phabricator
Date Aug. 11, 2017, 9:01 a.m.
Message ID <f82c88ca3b3c0d4b9bd360ac1eb0ac7e@localhost.localdomain>
Download mbox | patch
Permalink /patch/22859/
State Not Applicable
Headers show

Comments

phabricator - Aug. 11, 2017, 9:01 a.m.
quark updated this revision to Diff 772.
This revision is now accepted and ready to land.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D23?vs=157&id=772

REVISION DETAIL
  https://phab.mercurial-scm.org/D23

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-obsolete.t

CHANGE DETAILS




To: quark, durin42, #hg-reviewers
Cc: durin42, mercurial-devel

Patch

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -205,8 +205,8 @@ 
   o  0:cd010b8cd998 A
   
   $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True
+  note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D"
   rebasing 8:8877864f1edb "B"
-  note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D"
   rebasing 10:5ae4c968c6ac "C"
   $ hg debugobsolete
   42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
@@ -740,8 +740,8 @@ 
   $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=all
   obsoleted 1 changesets
   $ hg rebase -d 6 -r "4::"
+  note: not rebasing 7:360bbaa7d3ce "O", it has no successor
   rebasing 4:ff2c4d47b71d "C"
-  note: not rebasing 7:360bbaa7d3ce "O", it has no successor
   rebasing 8:8d47583e023f "P" (tip)
 
 If all the changeset to be rebased are obsolete and present in the destination, we
@@ -908,6 +908,7 @@ 
   |
   ~
   $ hg rebase -r ".^^ + .^ + ." -d 19
+  note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor"
   rebasing 20:b82fb57ea638 "willconflict second version"
   merging willconflict
   warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
@@ -919,7 +920,6 @@ 
   continue: hg rebase --continue
   $ hg rebase --continue
   rebasing 20:b82fb57ea638 "willconflict second version"
-  note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor"
   rebasing 22:7bdc8a87673d "dummy change" (tip)
   $ cd ..
 
@@ -1066,8 +1066,8 @@ 
   > EOF
 
   $ hg rebase -d C -b F
+  note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B"
   rebasing 2:b18e25de2cf5 "D" (D)
-  note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B"
   rebasing 5:66f1a38021c9 "F" (F tip)
   note: rebase of 5:66f1a38021c9 created no changes to commit
   $ hg log -G
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -446,14 +446,9 @@ 
             elif self.state[rev] == revignored:
                 ui.status(_('not rebasing ignored %s\n') % desc)
             elif self.state[rev] == revprecursor:
-                destctx = repo[self.obsoletenotrebased[rev]]
-                descdest = '%d:%s "%s"' % (destctx.rev(), destctx,
-                           destctx.description().split('\n', 1)[0])
-                msg = _('note: not rebasing %s, already in destination as %s\n')
-                ui.status(msg % (desc, descdest))
+                pass
             elif self.state[rev] == revpruned:
-                msg = _('note: not rebasing %s, it has no successor\n')
-                ui.status(msg % desc)
+                pass
             else:
                 ui.status(_('already rebased %s as %s\n') %
                           (desc, repo[self.state[rev]]))
@@ -1385,11 +1380,21 @@ 
         rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset))
         for ignored in set(rebasedomain) - set(rebaseset):
             state[ignored] = revignored
+    unfi = repo.unfiltered()
     for r in obsoletenotrebased:
-        if obsoletenotrebased[r] is None:
+        desc = _ctxdesc(unfi[r])
+        succ = obsoletenotrebased[r]
+        if succ is None:
+            msg = _('note: not rebasing %s, it has no successor\n') % desc
             state[r] = revpruned
         else:
+            destctx = unfi[succ]
+            destdesc = '%d:%s "%s"' % (destctx.rev(), destctx,
+                                       destctx.description().split('\n', 1)[0])
+            msg = (_('note: not rebasing %s, already in destination as %s\n')
+                   % (desc, destdesc))
             state[r] = revprecursor
+        repo.ui.status(msg)
     return originalwd, dest.rev(), state
 
 def clearrebased(ui, repo, dest, state, skipped, collapsedas=None):