rebase: clarify that commits that become empty are skipped
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 07 Dec 2018 14:23:17 -0800
changeset 40865 4edd427f34c1
parent 40864 09680349cc2d
child 40866 21e7c73af75f
rebase: clarify that commits that become empty are skipped Our message just said that it created no changes, but we didn't explicitly say that that meant that the the commit was not rebased. It also wasn't clear why it created no changes, so this patch also clarifies that that was because the changes were already in the destination. Differential Revision: https://phab.mercurial-scm.org/D5395
hgext/rebase.py
tests/test-rebase-abort.t
tests/test-rebase-cache.t
tests/test-rebase-collapse.t
tests/test-rebase-detach.t
tests/test-rebase-emptycommit.t
tests/test-rebase-interruptions.t
tests/test-rebase-mq-skip.t
tests/test-rebase-mq.t
tests/test-rebase-named-branches.t
tests/test-rebase-newancestor.t
tests/test-rebase-obsolete.t
tests/test-rebase-parameters.t
tests/test-rebase-scenario-global.t
tests/test-remotefilelog-linknodes.t
--- a/hgext/rebase.py	Fri Dec 07 14:17:09 2018 -0800
+++ b/hgext/rebase.py	Fri Dec 07 14:23:17 2018 -0800
@@ -573,8 +573,8 @@
                 ui.debug('rebased as %s\n' % short(newnode))
             else:
                 if not self.collapsef:
-                    ui.warn(_('note: rebase of %s created no changes '
-                              'to commit\n') % desc)
+                    ui.warn(_('note: not rebasing %s, its destination already '
+                              'has all its changes\n') % desc)
                     self.skipped.add(rev)
                 self.state[rev] = p1
                 ui.debug('next revision set to %d\n' % p1)
--- a/tests/test-rebase-abort.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-abort.t	Fri Dec 07 14:23:17 2018 -0800
@@ -206,7 +206,7 @@
   
   $ hg rebase -b 4 -d 2
   rebasing 3:a6484957d6b9 "B bis"
-  note: rebase of 3:a6484957d6b9 "B bis" created no changes to commit
+  note: not rebasing 3:a6484957d6b9 "B bis", its destination already has all its changes
   rebasing 4:145842775fec "C1" (tip)
   merging c
   warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
@@ -493,7 +493,7 @@
   $ hg commit -m 'add content draft' -q
 
   $ hg rebase -d 'public()' --tool :merge -q
-  note: rebase of 3:0682fd3dabf5 "disappear draft" created no changes to commit
+  note: not rebasing 3:0682fd3dabf5 "disappear draft", its destination already has all its changes
   warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see hg resolve, then hg rebase --continue)
   [1]
--- a/tests/test-rebase-cache.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-cache.t	Fri Dec 07 14:23:17 2018 -0800
@@ -231,7 +231,7 @@
   
   $ hg rebase -s 7 -d 6
   rebasing 7:653b9feb4616 "branch3"
-  note: rebase of 7:653b9feb4616 "branch3" created no changes to commit
+  note: not rebasing 7:653b9feb4616 "branch3", its destination already has all its changes
   rebasing 8:4666b71e8e32 "F" (tip)
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/653b9feb4616-3c88de16-rebase.hg
 
--- a/tests/test-rebase-collapse.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-collapse.t	Fri Dec 07 14:23:17 2018 -0800
@@ -500,7 +500,7 @@
   
   $ hg rebase -s 5 -d 4
   rebasing 5:fbfb97b1089a "E" (tip)
-  note: rebase of 5:fbfb97b1089a "E" (tip) created no changes to commit
+  note: not rebasing 5:fbfb97b1089a "E" (tip), its destination already has all its changes
   saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-553e1d85-rebase.hg
   $ hg tglog
   @  4: f338eb3c2c7c 'E'
--- a/tests/test-rebase-detach.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-detach.t	Fri Dec 07 14:23:17 2018 -0800
@@ -304,7 +304,7 @@
   continue: hg rebase --continue
   $ hg rebase -c
   rebasing 3:17b4880d2402 "B2" (tip)
-  note: rebase of 3:17b4880d2402 "B2" (tip) created no changes to commit
+  note: not rebasing 3:17b4880d2402 "B2" (tip), its destination already has all its changes
   saved backup bundle to $TESTTMP/a7/.hg/strip-backup/17b4880d2402-1ae1f6cc-rebase.hg
   $ hg  log -G --template "{rev}:{phase} '{desc}' {branches}\n"
   o  2:draft 'C'
--- a/tests/test-rebase-emptycommit.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-emptycommit.t	Fri Dec 07 14:23:17 2018 -0800
@@ -51,9 +51,9 @@
 
   $ hg rebase -r 3+4 -d E --keep
   rebasing 3:e7b3f00ed42e "D" (BOOK-D)
-  note: rebase of 3:e7b3f00ed42e "D" (BOOK-D) created no changes to commit
+  note: not rebasing 3:e7b3f00ed42e "D" (BOOK-D), its destination already has all its changes
   rebasing 4:69a34c08022a "E" (BOOK-E)
-  note: rebase of 4:69a34c08022a "E" (BOOK-E) created no changes to commit
+  note: not rebasing 4:69a34c08022a "E" (BOOK-E), its destination already has all its changes
   $ hg log -G -T '{rev} {desc} {bookmarks}'
   o  7 E BOOK-D BOOK-E
   |
@@ -84,9 +84,9 @@
   $ hg rebase -s 2 -d E
   rebasing 2:dc0947a82db8 "C" (BOOK-C C)
   rebasing 3:e7b3f00ed42e "D" (BOOK-D)
-  note: rebase of 3:e7b3f00ed42e "D" (BOOK-D) created no changes to commit
+  note: not rebasing 3:e7b3f00ed42e "D" (BOOK-D), its destination already has all its changes
   rebasing 4:69a34c08022a "E" (BOOK-E)
-  note: rebase of 4:69a34c08022a "E" (BOOK-E) created no changes to commit
+  note: not rebasing 4:69a34c08022a "E" (BOOK-E), its destination already has all its changes
   rebasing 5:6b2aeab91270 "F" (BOOK-F F)
   saved backup bundle to $TESTTMP/non-merge/.hg/strip-backup/dc0947a82db8-52bb4973-rebase.hg
   $ hg log -G -T '{rev} {desc} {bookmarks}'
@@ -131,11 +131,11 @@
 
   $ hg rebase -r '(A::)-(B::)-A' -d H
   rebasing 2:dc0947a82db8 "C" (BOOK-C)
-  note: rebase of 2:dc0947a82db8 "C" (BOOK-C) created no changes to commit
+  note: not rebasing 2:dc0947a82db8 "C" (BOOK-C), its destination already has all its changes
   rebasing 3:b18e25de2cf5 "D" (BOOK-D)
-  note: rebase of 3:b18e25de2cf5 "D" (BOOK-D) created no changes to commit
+  note: not rebasing 3:b18e25de2cf5 "D" (BOOK-D), its destination already has all its changes
   rebasing 4:86a1f6686812 "E" (BOOK-E E)
-  note: rebase of 4:86a1f6686812 "E" (BOOK-E E) created no changes to commit
+  note: not rebasing 4:86a1f6686812 "E" (BOOK-E E), its destination already has all its changes
   saved backup bundle to $TESTTMP/merge1/.hg/strip-backup/b18e25de2cf5-1fd0a4ba-rebase.hg
 
   $ hg log -G -T '{rev} {desc} {bookmarks}'
@@ -180,11 +180,11 @@
 
   $ hg rebase -r '(A::)-(B::)-A' -d H
   rebasing 2:dc0947a82db8 "C" (BOOK-C)
-  note: rebase of 2:dc0947a82db8 "C" (BOOK-C) created no changes to commit
+  note: not rebasing 2:dc0947a82db8 "C" (BOOK-C), its destination already has all its changes
   rebasing 3:b18e25de2cf5 "D" (BOOK-D D)
   rebasing 4:03ca77807e91 "E" (BOOK-E E)
   rebasing 5:ad6717a6a58e "F" (BOOK-F)
-  note: rebase of 5:ad6717a6a58e "F" (BOOK-F) created no changes to commit
+  note: not rebasing 5:ad6717a6a58e "F" (BOOK-F), its destination already has all its changes
   rebasing 6:c58e8bdac1f4 "G" (BOOK-G G)
   saved backup bundle to $TESTTMP/merge2/.hg/strip-backup/b18e25de2cf5-2d487005-rebase.hg
 
--- a/tests/test-rebase-interruptions.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-interruptions.t	Fri Dec 07 14:23:17 2018 -0800
@@ -454,7 +454,7 @@
   continue: hg rebase --continue
   $ hg rebase --continue
   rebasing 1:fdaca8533b86 "b"
-  note: rebase of 1:fdaca8533b86 "b" created no changes to commit
+  note: not rebasing 1:fdaca8533b86 "b", its destination already has all its changes
   saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fdaca8533b86-7fd70513-rebase.hg
   $ hg resolve --list
   $ test -d .hg/merge
--- a/tests/test-rebase-mq-skip.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-mq-skip.t	Fri Dec 07 14:23:17 2018 -0800
@@ -62,7 +62,7 @@
   committing changelog
   rebasing 3:148775c71080 "P1" (p1.patch qtip)
   resolving manifests
-  note: rebase of 3:148775c71080 "P1" (p1.patch qtip) created no changes to commit
+  note: not rebasing 3:148775c71080 "P1" (p1.patch qtip), its destination already has all its changes
   rebase merging completed
   updating mq patch p0.patch to 5:9ecc820b1737
   $TESTTMP/a/.hg/patches/p0.patch
@@ -143,10 +143,10 @@
 
   $ HGMERGE=internal:fail hg rebase
   rebasing 1:b4bffa6e4776 "r1" (qbase r1)
-  note: rebase of 1:b4bffa6e4776 "r1" (qbase r1) created no changes to commit
+  note: not rebasing 1:b4bffa6e4776 "r1" (qbase r1), its destination already has all its changes
   rebasing 2:c0fd129beb01 "r2" (r2)
   rebasing 3:6ff5b8feed8e "r3" (r3)
-  note: rebase of 3:6ff5b8feed8e "r3" (r3) created no changes to commit
+  note: not rebasing 3:6ff5b8feed8e "r3" (r3), its destination already has all its changes
   rebasing 4:094320fec554 "r4" (r4)
   unresolved conflicts (see hg resolve, then hg rebase --continue)
   [1]
@@ -160,10 +160,10 @@
   already rebased 2:c0fd129beb01 "r2" (r2) as 1660ab13ce9a
   already rebased 3:6ff5b8feed8e "r3" (r3) as 1660ab13ce9a
   rebasing 4:094320fec554 "r4" (r4)
-  note: rebase of 4:094320fec554 "r4" (r4) created no changes to commit
+  note: not rebasing 4:094320fec554 "r4" (r4), its destination already has all its changes
   rebasing 5:681a378595ba "r5" (r5)
   rebasing 6:512a1f24768b "r6" (qtip r6)
-  note: rebase of 6:512a1f24768b "r6" (qtip r6) created no changes to commit
+  note: not rebasing 6:512a1f24768b "r6" (qtip r6), its destination already has all its changes
   saved backup bundle to $TESTTMP/b/.hg/strip-backup/b4bffa6e4776-b9bfb84d-rebase.hg
 
   $ hg tglog
--- a/tests/test-rebase-mq.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-mq.t	Fri Dec 07 14:23:17 2018 -0800
@@ -337,7 +337,7 @@
   foo
   $ [ -f .hg/patches/empty-important ]
   $ hg -q rebase -d 2
-  note: rebase of 1:0aaf4c3af7eb "important commit message" (empty-important qbase) created no changes to commit
+  note: not rebasing 1:0aaf4c3af7eb "important commit message" (empty-important qbase), its destination already has all its changes
   $ hg qseries
   guarded
   bar
--- a/tests/test-rebase-named-branches.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-named-branches.t	Fri Dec 07 14:23:17 2018 -0800
@@ -157,7 +157,7 @@
   
   $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
   rebasing 5:bc8139ee757c "dev-one named branch"
-  note: rebase of 5:bc8139ee757c "dev-one named branch" created no changes to commit
+  note: not rebasing 5:bc8139ee757c "dev-one named branch", its destination already has all its changes
   rebasing 6:42aa3cf0fa7a "F"
   rebasing 7:1a1e6f72ec38 "G"
   rebasing 8:904590360559 "H"
@@ -329,7 +329,7 @@
   $ hg up -qr 2
   $ hg rebase
   rebasing 2:792845bb77ee "b2"
-  note: rebase of 2:792845bb77ee "b2" created no changes to commit
+  note: not rebasing 2:792845bb77ee "b2", its destination already has all its changes
   saved backup bundle to $TESTTMP/case1/.hg/strip-backup/792845bb77ee-627120ee-rebase.hg
   $ hg tglog
   o  2: c062e3ecd6c6 'c1' c
@@ -395,7 +395,7 @@
   $ hg rebase -r 3:: -d .
   rebasing 3:76abc1c6f8c7 "b1"
   rebasing 4:8427af5d86f2 "c2 closed" (tip)
-  note: rebase of 4:8427af5d86f2 "c2 closed" (tip) created no changes to commit
+  note: not rebasing 4:8427af5d86f2 "c2 closed" (tip), its destination already has all its changes
   saved backup bundle to $TESTTMP/case2/.hg/strip-backup/76abc1c6f8c7-cd698d13-rebase.hg
   $ hg tglog
   o  3: 117b0ed08075 'b1' x
--- a/tests/test-rebase-newancestor.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-newancestor.t	Fri Dec 07 14:23:17 2018 -0800
@@ -130,7 +130,7 @@
   > c
   > EOF
   rebasing 1:1d1a643d390e "dev: create branch"
-  note: rebase of 1:1d1a643d390e "dev: create branch" created no changes to commit
+  note: not rebasing 1:1d1a643d390e "dev: create branch", its destination already has all its changes
   rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
   rebasing 4:4b019212aaf6 "dev: merge default"
   file 'f-default' was deleted in local [dest] but was modified in other [source].
--- a/tests/test-rebase-obsolete.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-obsolete.t	Fri Dec 07 14:23:17 2018 -0800
@@ -129,10 +129,10 @@
   grafting 3:32af7686d403 "D"
   $ hg rebase  -s 42ccdea3bb16 -d .
   rebasing 1:42ccdea3bb16 "B"
-  note: rebase of 1:42ccdea3bb16 "B" created no changes to commit
+  note: not rebasing 1:42ccdea3bb16 "B", its destination already has all its changes
   rebasing 2:5fddd98957c8 "C"
   rebasing 3:32af7686d403 "D"
-  note: rebase of 3:32af7686d403 "D" created no changes to commit
+  note: not rebasing 3:32af7686d403 "D", its destination already has all its changes
   $ hg log -G
   o  10:5ae4c968c6ac C
   |
@@ -1456,7 +1456,7 @@
   rebasing 2:b18e25de2cf5 "D" (D)
   note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B)
   rebasing 5:66f1a38021c9 "F" (F tip)
-  note: rebase of 5:66f1a38021c9 "F" (F tip) created no changes to commit
+  note: not rebasing 5:66f1a38021c9 "F" (F tip), its destination already has all its changes
   $ hg log -G
   o  6:8f47515dda15 D
   |
@@ -1492,7 +1492,7 @@
   note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B)
   rebasing 3:7fb047a69f22 "E" (E)
   rebasing 5:66f1a38021c9 "F" (F tip)
-  note: rebase of 5:66f1a38021c9 "F" (F tip) created no changes to commit
+  note: not rebasing 5:66f1a38021c9 "F" (F tip), its destination already has all its changes
 
   $ hg log -G
   o  6:533690786a86 E
--- a/tests/test-rebase-parameters.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-parameters.t	Fri Dec 07 14:23:17 2018 -0800
@@ -440,7 +440,7 @@
 
   $ hg rebase -s 2 -d 1 --tool internal:local
   rebasing 2:e4e3f3546619 "c2b" (tip)
-  note: rebase of 2:e4e3f3546619 "c2b" (tip) created no changes to commit
+  note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes
   saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg
 
   $ hg cat c2
@@ -493,7 +493,7 @@
   [255]
   $ hg rebase -c --tool internal:fail
   rebasing 2:e4e3f3546619 "c2b" (tip)
-  note: rebase of 2:e4e3f3546619 "c2b" (tip) created no changes to commit
+  note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes
   saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg
 
   $ hg rebase -i
--- a/tests/test-rebase-scenario-global.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-rebase-scenario-global.t	Fri Dec 07 14:23:17 2018 -0800
@@ -138,7 +138,7 @@
   $ hg rebase -s 4 -d 7
   rebasing 4:9520eea781bc "E"
   rebasing 6:eea13746799a "G"
-  note: rebase of 6:eea13746799a "G" created no changes to commit
+  note: not rebasing 6:eea13746799a "G", its destination already has all its changes
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-fcd8edd4-rebase.hg
   $ f E.orig
   E.orig: file not found
@@ -169,7 +169,7 @@
   $ hg rebase -s 5 -d 4
   rebasing 5:24b6387c8c8c "F"
   rebasing 6:eea13746799a "G"
-  note: rebase of 6:eea13746799a "G" created no changes to commit
+  note: not rebasing 6:eea13746799a "G", its destination already has all its changes
   rebasing 7:02de42196ebe "H" (tip)
   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg
 
--- a/tests/test-remotefilelog-linknodes.t	Fri Dec 07 14:17:09 2018 -0800
+++ b/tests/test-remotefilelog-linknodes.t	Fri Dec 07 14:23:17 2018 -0800
@@ -87,7 +87,7 @@
   $ hg pull -q
   $ hg rebase -d tip
   rebasing 1:4549721d828f "xx2"
-  note: rebase of 1:4549721d828f "xx2" created no changes to commit
+  note: not rebasing 1:4549721d828f "xx2", its destination already has all its changes
   rebasing 2:5ef6d97e851c "xxy"
   saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/4549721d828f-b084e33c-rebase.hg (glob)
   $ hg log -f x --template '{node|short}\n'