changeset 71:19e1930587a0

[obsolete] Move extension compat code
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 13 Sep 2011 21:37:28 +0200
parents af4f7ef0a3c1
children 774932a6cc0d
files hgext/obsolete.py
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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
-