Commits

Pierre-Yves David  committed 19e1930

[obsolete] Move extension compat code

  • Participants
  • Parent commits af4f7ef
  • Branches default

Comments (0)

Files changed (1)

File hgext/obsolete.py

     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
 
 
 pushkey.register('obsolete', pushobsolete, listobsolete)
 
-# New commands
+### New commands
 #############################
 
 
 
     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
-