--- a/obsolete.py Wed Sep 07 18:39:02 2011 +0200
+++ b/obsolete.py Thu Sep 08 12:08:33 2011 +0200
@@ -10,6 +10,7 @@
from mercurial import context
from mercurial import revset
from mercurial import scmutil
+from mercurial import extensions
from mercurial.node import hex, bin
# Patch changectx
@@ -45,6 +46,12 @@
def extsetup(ui):
revset.symbols["obsolete"] = revsetobsolete
+ try:
+ rebase = extensions.find('rebase')
+ if rebase:
+ extensions.wrapfunction(rebase, 'concludenode', concludenode)
+ except KeyError:
+ pass # rebase not found
# New commands
#############################
@@ -139,3 +146,13 @@
repo.__class__ = obsoletingrepo
+### Other Extension compat
+############################
+
+def concludenode(orig, repo, rev, *args, **kwargs):
+ newrev = orig(repo, rev, *args, **kwargs)
+ oldnode = repo[rev].node()
+ newnode = repo[newrev].node()
+ repo.addobsolete(newnode, oldnode)
+ return newrev
+