Mercurial > public > mercurial-scm > hg-stable
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 Sun Jul 30 22:52:34 2006 -0700 +++ b/mercurial/util.py Mon Jul 31 07:11:12 2006 -0700 @@ -996,3 +996,11 @@ 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