diff mercurial/util.py @ 2740:386f04d6ecb3

clean up hg.py: move repo constructor code into each repo module
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Mon, 31 Jul 2006 07:11:12 -0700
parents df5e58c84b01
children e6bef16b6cec
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -996,3 +996,11 @@ def bytecount(nbytes):
         if nbytes >= divisor * multiplier:
             return format % (nbytes / float(divisor))
     return units[-1][2] % nbytes
+
+def drop_scheme(scheme, path):
+    sc = scheme + ':'
+    if path.startswith(sc):
+        path = path[len(sc):]
+        if path.startswith('//'):
+            path = path[2:]
+    return path