[PATCH 4 of 6] rebase: show warning when rebase creates no changes to commit

Mads Kiilerich mads at kiilerich.com
Tue Dec 9 23:20:45 CST 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1418188835 -3600
#      Wed Dec 10 06:20:35 2014 +0100
# Node ID 2fb0504b817519358354d60cea2c10ab1e378e67
# Parent  4f18e80d9c302290628f6f15190374aff1cb28fc
rebase: show warning when rebase creates no changes to commit

Similar to graft:
  note: rebase of 6:eea13746799a created no changes to commit

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -412,8 +412,9 @@ def rebase(ui, repo, **opts):
                 if newnode is not None:
                     state[rev] = repo[newnode].rev()
                 else:
+                    ui.warn(_('note: rebase of %d:%s created no changes '
+                              'to commit\n') % (rev, ctx))
                     if not collapsef:
-                        ui.note(_('no changes, revision %d skipped\n') % rev)
                         ui.debug('next revision set to %s\n' % p1)
                         skipped.add(rev)
                     state[rev] = p1
diff --git a/tests/test-rebase-abort.t b/tests/test-rebase-abort.t
--- a/tests/test-rebase-abort.t
+++ b/tests/test-rebase-abort.t
@@ -162,6 +162,7 @@ Rebase and abort without generating new 
   
   $ hg rebase -b 4 -d 2
   rebasing 3:a6484957d6b9 "B bis"
+  note: rebase of 3:a6484957d6b9 created no changes to commit
   rebasing 4:145842775fec "C1" (tip)
   merging c
   warning: conflicts during merge.
diff --git a/tests/test-rebase-cache.t b/tests/test-rebase-cache.t
--- a/tests/test-rebase-cache.t
+++ b/tests/test-rebase-cache.t
@@ -234,6 +234,7 @@ Rebase entire branch3 (7-8) onto branch2
   
   $ hg rebase -s 7 -d 6
   rebasing 7:653b9feb4616 "branch3"
+  note: rebase of 7:653b9feb4616 created no changes to commit
   rebasing 8:4666b71e8e32 "F" (tip)
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/653b9feb4616-backup.hg (glob)
 
diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t
--- a/tests/test-rebase-collapse.t
+++ b/tests/test-rebase-collapse.t
@@ -60,8 +60,11 @@ Rebasing B onto H and collapsing changes
   > EOF
   $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e
   rebasing 1:42ccdea3bb16 "B"
+  note: rebase of 1:42ccdea3bb16 created no changes to commit
   rebasing 2:5fddd98957c8 "C"
+  note: rebase of 2:5fddd98957c8 created no changes to commit
   rebasing 3:32af7686d403 "D"
+  note: rebase of 3:32af7686d403 created no changes to commit
   ==== before editing
   Collapsed revision
   * B
@@ -117,7 +120,9 @@ Rebasing E onto H:
   $ hg phase --force --secret 6
   $ hg rebase --source 4 --collapse
   rebasing 4:9520eea781bc "E"
+  note: rebase of 4:9520eea781bc created no changes to commit
   rebasing 6:eea13746799a "G"
+  note: rebase of 6:eea13746799a created no changes to commit
   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/9520eea781bc-backup.hg (glob)
 
   $ hg tglog
@@ -159,7 +164,9 @@ Rebasing G onto H with custom message:
   > EOF
   $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source 4 --collapse -m 'custom message' -e
   rebasing 4:9520eea781bc "E"
+  note: rebase of 4:9520eea781bc created no changes to commit
   rebasing 6:eea13746799a "G"
+  note: rebase of 6:eea13746799a created no changes to commit
   HGEDITFORM=rebase.collapse
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-backup.hg (glob)
 
@@ -269,8 +276,11 @@ Rebase and collapse - E onto H:
 
   $ hg rebase -s 4 --collapse # root (4) is not a merge
   rebasing 4:8a5212ebc852 "E"
+  note: rebase of 4:8a5212ebc852 created no changes to commit
   rebasing 5:7f219660301f "F"
+  note: rebase of 5:7f219660301f created no changes to commit
   rebasing 6:c772a8b2dc17 "G"
+  note: rebase of 6:c772a8b2dc17 created no changes to commit
   saved backup bundle to $TESTTMP/b1/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
 
   $ hg tglog
@@ -420,10 +430,14 @@ Rebase and collapse - E onto I:
 
   $ hg rebase -s 4 --collapse # root (4) is not a merge
   rebasing 4:8a5212ebc852 "E"
+  note: rebase of 4:8a5212ebc852 created no changes to commit
   rebasing 5:dca5924bb570 "F"
   merging E
+  note: rebase of 5:dca5924bb570 created no changes to commit
   rebasing 6:55a44ad28289 "G"
+  note: rebase of 6:55a44ad28289 created no changes to commit
   rebasing 7:417d3b648079 "H"
+  note: rebase of 7:417d3b648079 created no changes to commit
   saved backup bundle to $TESTTMP/c1/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
 
   $ hg tglog
@@ -514,9 +528,13 @@ Rebase and collapse - B onto F:
 
   $ hg rebase -s 1 --collapse
   rebasing 1:27547f69f254 "B"
+  note: rebase of 1:27547f69f254 created no changes to commit
   rebasing 2:f838bfaca5c7 "C"
+  note: rebase of 2:f838bfaca5c7 created no changes to commit
   rebasing 3:7bbcd6078bcc "D"
+  note: rebase of 3:7bbcd6078bcc created no changes to commit
   rebasing 4:0a42590ed746 "E"
+  note: rebase of 4:0a42590ed746 created no changes to commit
   saved backup bundle to $TESTTMP/d1/.hg/strip-backup/27547f69f254-backup.hg (glob)
 
   $ hg tglog
@@ -602,6 +620,7 @@ Interactions between collapse and keepbr
   
   $ hg rebase -s 5 -d 4
   rebasing 5:fbfb97b1089a "E" (tip)
+  note: rebase of 5:fbfb97b1089a created no changes to commit
   saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-backup.hg (glob)
   $ hg tglog
   @  4: 'E'
@@ -657,9 +676,11 @@ Rebase, collapse and copies
   merging a and d to d
   merging b and e to e
   merging c and f to f
+  note: rebase of 2:6e7340ee38c0 created no changes to commit
   rebasing 3:338e84e2e558 "move2" (tip)
   merging f and c to c
   merging e and g to g
+  note: rebase of 3:338e84e2e558 created no changes to commit
   saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-backup.hg (glob)
   $ hg st
   $ hg st --copies --change tip
@@ -700,7 +721,9 @@ Test collapsing in place
 
   $ hg rebase --collapse -b . -d 0
   rebasing 1:1352765a01d4 "change"
+  note: rebase of 1:1352765a01d4 created no changes to commit
   rebasing 2:64b456429f67 "Collapsed revision" (tip)
+  note: rebase of 2:64b456429f67 created no changes to commit
   saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-backup.hg (glob)
   $ hg st --change tip --copies
   M a
@@ -792,7 +815,9 @@ Test collapsing changes that add then re
   $ hg book foo
   $ hg rebase -d 0 -r "1::2" --collapse -m collapsed
   rebasing 1:6d8d9f24eec3 "a"
+  note: rebase of 1:6d8d9f24eec3 created no changes to commit
   rebasing 2:1cc73eca5ecc "b" (tip foo)
+  note: rebase of 2:1cc73eca5ecc created no changes to commit
   saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-backup.hg (glob)
   $ hg log -G --template "{rev}: '{desc}' {bookmarks}"
   @  1: 'collapsed' foo
diff --git a/tests/test-rebase-detach.t b/tests/test-rebase-detach.t
--- a/tests/test-rebase-detach.t
+++ b/tests/test-rebase-detach.t
@@ -212,7 +212,9 @@ Rebasing C onto H detaching from B and c
   
   $ hg rebase --collapse -s 2 -d 7
   rebasing 2:5fddd98957c8 "C"
+  note: rebase of 2:5fddd98957c8 created no changes to commit
   rebasing 3:32af7686d403 "D"
+  note: rebase of 3:32af7686d403 created no changes to commit
   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
 
   $ hg  log -G --template "{rev}:{phase} '{desc}' {branches}\n"
@@ -339,8 +341,11 @@ Verify that target is not selected as ex
 
   $ hg rebase -s 8 -d 7 --collapse --config ui.merge=internal:other
   rebasing 8:9790e768172d "I"
+  note: rebase of 8:9790e768172d created no changes to commit
   rebasing 9:5d7b11f5fb97 "Merge"
+  note: rebase of 9:5d7b11f5fb97 created no changes to commit
   rebasing 10:9427d4d5af81 "J" (tip)
+  note: rebase of 10:9427d4d5af81 created no changes to commit
   saved backup bundle to $TESTTMP/a6/.hg/strip-backup/9790e768172d-backup.hg (glob)
 
   $ hg tglog
@@ -394,6 +399,7 @@ Ensure --continue restores a correct sta
   (no more unresolved files)
   $ hg rebase -c
   rebasing 8:6215fafa5447 "H2" (tip)
+  note: rebase of 8:6215fafa5447 created no changes to commit
   saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6215fafa5447-backup.hg (glob)
   $ hg  log -G --template "{rev}:{phase} '{desc}' {branches}\n"
   @  7:draft 'H'
diff --git a/tests/test-rebase-mq-skip.t b/tests/test-rebase-mq-skip.t
--- a/tests/test-rebase-mq-skip.t
+++ b/tests/test-rebase-mq-skip.t
@@ -52,6 +52,7 @@ already has one local mq patch
   $ hg rebase
   rebasing 2:13a46ce44f60 "P0" (p0.patch qbase)
   rebasing 3:148775c71080 "P1" (p1.patch qtip)
+  note: rebase of 3:148775c71080 created no changes to commit
   saved backup bundle to $TESTTMP/a/.hg/strip-backup/13a46ce44f60-backup.hg (glob)
 
   $ hg tglog
@@ -110,8 +111,10 @@ already has one local mq patch
 
   $ HGMERGE=internal:fail hg rebase
   rebasing 1:b4bffa6e4776 "r1" (1.diff qbase)
+  note: rebase of 1:b4bffa6e4776 created no changes to commit
   rebasing 2:c0fd129beb01 "r2" (2.diff)
   rebasing 3:6ff5b8feed8e "r3" (3.diff)
+  note: rebase of 3:6ff5b8feed8e created no changes to commit
   rebasing 4:094320fec554 "r4" (4.diff)
   unresolved conflicts (see hg resolve, then hg rebase --continue)
   [1]
@@ -124,8 +127,10 @@ already has one local mq patch
   already rebased 2:c0fd129beb01 "r2" (2.diff) as 1660ab13ce9a
   already rebased 3:6ff5b8feed8e "r3" (3.diff) as 1660ab13ce9a
   rebasing 4:094320fec554 "r4" (4.diff)
+  note: rebase of 4:094320fec554 created no changes to commit
   rebasing 5:681a378595ba "r5" (5.diff)
   rebasing 6:512a1f24768b "r6" (6.diff qtip)
+  note: rebase of 6:512a1f24768b created no changes to commit
   saved backup bundle to $TESTTMP/b/.hg/strip-backup/b4bffa6e4776-backup.hg (glob)
 
   $ hg tglog
diff --git a/tests/test-rebase-mq.t b/tests/test-rebase-mq.t
--- a/tests/test-rebase-mq.t
+++ b/tests/test-rebase-mq.t
@@ -337,6 +337,7 @@ removed from the series):
   foo
   $ [ -f .hg/patches/empty-important ]
   $ hg -q rebase -d 2
+  note: rebase of 1:0aaf4c3af7eb created no changes to commit
   $ hg qseries
   guarded
   bar
diff --git a/tests/test-rebase-named-branches.t b/tests/test-rebase-named-branches.t
--- a/tests/test-rebase-named-branches.t
+++ b/tests/test-rebase-named-branches.t
@@ -98,6 +98,7 @@ Branch name containing a dash (issue3181
   
   $ hg rebase -s dev-one -d 0 --keepbranches
   rebasing 5:643fc9128048 "dev-one named branch"
+  note: rebase of 5:643fc9128048 created no changes to commit
   rebasing 6:24de4aff8e28 "F"
   rebasing 7:4b988a958030 "G"
   rebasing 8:31d0e4ba75e6 "H"
@@ -181,6 +182,7 @@ Branch name containing a dash (issue3181
   
   $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches
   rebasing 5:643fc9128048 "dev-one named branch"
+  note: rebase of 5:643fc9128048 created no changes to commit
   rebasing 6:05584c618d45 "F"
   rebasing 7:471695f5257d "G"
   rebasing 8:8382a539a2df "H"
diff --git a/tests/test-rebase-newancestor.t b/tests/test-rebase-newancestor.t
--- a/tests/test-rebase-newancestor.t
+++ b/tests/test-rebase-newancestor.t
@@ -128,6 +128,7 @@ Full rebase all the way back from branch
 
   $ hg rebase -r 'only(dev,default)' -d default
   rebasing 1:1d1a643d390e "dev: create branch"
+  note: rebase of 1:1d1a643d390e created no changes to commit
   rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
   rebasing 4:4b019212aaf6 "dev: merge default"
   remote changed f-default which local deleted
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
@@ -125,8 +125,10 @@ set.
   grafting 3:32af7686d403 "D"
   $ hg rebase  -s 42ccdea3bb16 -d .
   rebasing 1:42ccdea3bb16 "B"
+  note: rebase of 1:42ccdea3bb16 created no changes to commit
   rebasing 2:5fddd98957c8 "C"
   rebasing 3:32af7686d403 "D"
+  note: rebase of 3:32af7686d403 created no changes to commit
   $ hg log -G
   o  10:5ae4c968c6ac C
   |
@@ -204,6 +206,7 @@ More complex case were part of the rebas
   $ hg rebase --source 'desc(B)' --dest 'tip'
   rebasing 8:8877864f1edb "B"
   rebasing 9:08483444fef9 "D"
+  note: rebase of 9:08483444fef9 created no changes to commit
   rebasing 10:5ae4c968c6ac "C"
   $ hg debugobsolete
   42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
@@ -258,8 +261,11 @@ collapse rebase
   $ cd collapse
   $ hg rebase  -s 42ccdea3bb16 -d eea13746799a --collapse
   rebasing 1:42ccdea3bb16 "B"
+  note: rebase of 1:42ccdea3bb16 created no changes to commit
   rebasing 2:5fddd98957c8 "C"
+  note: rebase of 2:5fddd98957c8 created no changes to commit
   rebasing 3:32af7686d403 "D"
+  note: rebase of 3:32af7686d403 created no changes to commit
   $ hg log -G
   o  8:4dc2197e807b Collapsed revision
   |
diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -438,6 +438,7 @@ Test --tool parameter:
 
   $ hg rebase -s 2 -d 1 --tool internal:local
   rebasing 2:e4e3f3546619 "c2b" (tip)
+  note: rebase of 2:e4e3f3546619 created no changes to commit
   saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
 
   $ hg cat c2
@@ -485,6 +486,7 @@ Test --tool parameter:
   $ hg rebase -c --tool internal:fail
   tool option will be ignored
   rebasing 2:e4e3f3546619 "c2b" (tip)
+  note: rebase of 2:e4e3f3546619 created no changes to commit
   saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
 
   $ hg rebase -i
diff --git a/tests/test-rebase-rename.t b/tests/test-rebase-rename.t
--- a/tests/test-rebase-rename.t
+++ b/tests/test-rebase-rename.t
@@ -310,10 +310,13 @@ copy records collapse correctly.
   created new head
   $ hg rebase -s 2 --dest 5 --collapse
   rebasing 2:68bf06433839 "File b created as copy of a and modified"
+  note: rebase of 2:68bf06433839 created no changes to commit
   rebasing 3:af74b229bc02 "File c created as copy of b and modified"
   merging b and c to c
+  note: rebase of 3:af74b229bc02 created no changes to commit
   rebasing 4:dbb9ba033561 "File d created as copy of c and modified"
   merging c and d to d
+  note: rebase of 4:dbb9ba033561 created no changes to commit
   saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/68bf06433839-backup.hg (glob)
   $ hg co tip
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t
--- a/tests/test-rebase-scenario-global.t
+++ b/tests/test-rebase-scenario-global.t
@@ -121,6 +121,7 @@ E onto H - skip of G:
   $ hg rebase -s 4 -d 7
   rebasing 4:9520eea781bc "E"
   rebasing 6:eea13746799a "G"
+  note: rebase of 6:eea13746799a created no changes to commit
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-backup.hg (glob)
 
   $ hg tglog
@@ -149,6 +150,7 @@ F onto E - rebase of a branching point (
   $ hg rebase -s 5 -d 4
   rebasing 5:24b6387c8c8c "F"
   rebasing 6:eea13746799a "G"
+  note: rebase of 6:eea13746799a created no changes to commit
   rebasing 7:02de42196ebe "H" (tip)
   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-backup.hg (glob)
 
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -387,6 +387,7 @@ if we resolve a conflict while unshelvin
   rebasing shelved changes
   rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
   merging a/a
+  note: rebase of 6:c5e6910e7601 created no changes to commit
   $ hg parents -q
   4:33f7f61e6c5e
   $ hg shelve -l
@@ -724,6 +725,7 @@ is a no-op), works (issue4398)
   (no more unresolved files)
   $ hg unshelve -c
   rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
+  note: rebase of 5:4b555fdb4e96 created no changes to commit
   unshelve of 'default' complete
   $ hg diff
   $ hg status


More information about the Mercurial-devel mailing list