comparison 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
comparison
equal deleted inserted replaced
2739:3248aa10b388 2740:386f04d6ecb3
994 994
995 for multiplier, divisor, format in units: 995 for multiplier, divisor, format in units:
996 if nbytes >= divisor * multiplier: 996 if nbytes >= divisor * multiplier:
997 return format % (nbytes / float(divisor)) 997 return format % (nbytes / float(divisor))
998 return units[-1][2] % nbytes 998 return units[-1][2] % nbytes
999
1000 def drop_scheme(scheme, path):
1001 sc = scheme + ':'
1002 if path.startswith(sc):
1003 path = path[len(sc):]
1004 if path.startswith('//'):
1005 path = path[2:]
1006 return path