[obsolete] rebase always keep changeset.
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 19 Sep 2011 01:56:48 +0200
changeset 84 c4cc5f3bcf12
parent 83 97a5c943db19
child 85 531058dbd703
[obsolete] rebase always keep changeset.
hgext/obsolete.py
--- a/hgext/obsolete.py	Mon Sep 19 01:55:35 2011 +0200
+++ b/hgext/obsolete.py	Mon Sep 19 01:56:48 2011 +0200
@@ -139,6 +139,14 @@
     repo.addobsolete(newnode, oldnode)
     return newrev
 
+def cmdrebase(orig, repo, ui, *args, **kwargs):
+    oldkeep = kwargs.pop('keep', False)
+    if oldkeep:
+        ui.warn('WARNING --keep option ignored by experimental obsolete extension')
+    kwargs['keep'] = True
+    return orig(repo, ui, *args, **kwargs)
+
+
 ### Filter obsolet changeset
 ############################
 
@@ -179,6 +187,7 @@
         rebase = extensions.find('rebase')
         if rebase:
             extensions.wrapfunction(rebase, 'concludenode', concludenode)
+            extensions.wrapcommand(rebase.cmdtable, "rebase", cmdrebase)
     except KeyError:
         pass # rebase not found