obsolete: warn when the whole rebase set was remove because extinct
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 21 Aug 2012 02:25:19 +0200
changeset 471 8be3973adf34
parent 470 a2dfe82f27a0
child 472 641e0cd43d6d
obsolete: warn when the whole rebase set was remove because extinct
hgext/obsolete.py
tests/test-obsolete.t
--- a/hgext/obsolete.py	Mon Aug 20 19:12:20 2012 +0200
+++ b/hgext/obsolete.py	Tue Aug 21 02:25:19 2012 +0200
@@ -956,6 +956,9 @@
 def buildstate(orig, repo, dest, rebaseset, *ags, **kws):
     """wrapper for rebase 's buildstate that exclude obsolete changeset"""
     rebaseset = repo.revs('%ld - extinct()', rebaseset)
+    if not rebaseset:
+        repo.ui.warn(_('whole rebase set is extinct and ignored.\n'))
+        return {}
     return orig(repo, dest, rebaseset, *ags, **kws)
 
 def defineparents(orig, repo, rev, target, state, *args, **kwargs):
--- a/tests/test-obsolete.t	Mon Aug 20 19:12:20 2012 +0200
+++ b/tests/test-obsolete.t	Tue Aug 21 02:25:19 2012 +0200
@@ -474,6 +474,10 @@
 
 should not rebase extinct changeset
 
+  $ hg --config extensions.hgext.rebase= rebase -s 7 -d 4
+  whole rebase set is extinct and ignored.
+  nothing to rebase
+  [1]
   $ hg --config extensions.hgext.rebase= rebase -b 3 -d 4 --traceback
   $ hg --config extensions.graphlog= glog -r 'not extinct()'  --template='{rev} - {node|short}\n'
   @  11 - 9468a5f5d8b2