[cig-commits] commit: Backwards compatibility layer for cmdutil.parseurl().

Mercurial hg at geodynamics.org
Mon Nov 24 11:27:14 PST 2008


changeset:   72:1c916e260ece
user:        Simon Law <simon at akoha.org>
date:        Wed Aug 29 12:10:35 2007 -0400
files:       forest.py
description:
Backwards compatibility layer for cmdutil.parseurl().


diff -r 73f97f3eef54 -r 1c916e260ece forest.py
--- a/forest.py	Mon Aug 27 13:53:22 2007 -0400
+++ b/forest.py	Wed Aug 29 12:10:35 2007 -0400
@@ -72,10 +72,18 @@ except AttributeError:
     findcmd.findcmd = commands.findcmd
     findcmd.__doc__ = commands.findcmd.__doc__
 
+# For backwards compatibility, find the parseurl() function that splits
+# urls and revisions.  Mercurial 0.9.3 doesn't have this, so we need
+# to provide a stub.
 try:
-    parseurl = hg.parseurl
+    parseurl = cmdutil.parseurl
 except:
-    parseurl = cmdutil.parseurl
+    try:
+        parseurl = hg.parseurl
+    except:
+        def parseurl(url, revs):
+            """Mercurial <= 0.9.3 doesn't have this feature."""
+            return url, (revs or None)
 
 
 def cmd_options(ui, cmd, remove=None):



More information about the CIG-COMMITS mailing list