[obsolete] Move extension compat code
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 13 Sep 2011 21:37:28 +0200
changeset 71 19e1930587a0
parent 70 af4f7ef0a3c1
child 72 774932a6cc0d
[obsolete] Move extension compat code
hgext/obsolete.py
--- a/hgext/obsolete.py	Tue Sep 13 21:29:52 2011 +0200
+++ b/hgext/obsolete.py	Tue Sep 13 21:37:28 2011 +0200
@@ -119,6 +119,17 @@
     args = revset.getargs(x, 0, 0, 'publicheads takes no arguments')
     return [r for r in subset if repo[r].obsolete()] # XXX slow
 
+### 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
+
+
 def extsetup(ui):
     revset.symbols["obsolete"] = revsetobsolete
 
@@ -179,7 +190,7 @@
 
 pushkey.register('obsolete', pushobsolete, listobsolete)
 
-# New commands
+### New commands
 #############################
 
 
@@ -356,14 +367,3 @@
 
     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
-