mercurial/util.py
changeset 2740 386f04d6ecb3
parent 2648 df5e58c84b01
child 2760 e6bef16b6cec
--- 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