aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-09-05 18:14:18 -0400
committerW. Trevor King <wking@drexel.edu>2010-09-05 18:14:18 -0400
commit81d967b11d7ba19f2a84a42dbeeaaeb2ecbe0b75 (patch)
treef2ce074c9779ab84ff7d8affbe8aed5fb79afac4 /libbe
parent226036d2254feee8e50061e519c2bdaefef7ccfb (diff)
downloadbugseverywhere-81d967b11d7ba19f2a84a42dbeeaaeb2ecbe0b75.tar.gz
Don't assume len(os.path.sep) == 1 in libbe.storage.vcs.base.
Diffstat (limited to 'libbe')
-rw-r--r--libbe/storage/vcs/base.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py
index ed72dd1..48bd034 100644
--- a/libbe/storage/vcs/base.py
+++ b/libbe/storage/vcs/base.py
@@ -224,7 +224,7 @@ class CachedPathID (object):
continue
try:
id = self.id(dirpath)
- relpath = dirpath[len(self._root)+1:]
+ relpath = dirpath[len(self._root + os.path.sep):]
if id.count('/') == 0:
if verbose == True and id in self._cache:
print >> sys.stderr, 'Multiple paths for %s: \n %s\n %s' % (id, self._cache[id], relpath)
@@ -313,15 +313,15 @@ class CachedPathID (object):
path = os.path.join(self._root, path)
if not path.startswith(self._root + os.path.sep):
raise InvalidPath(path, self._root)
- path = path[len(self._root)+1:]
+ path = path[len(self._root + os.path.sep):]
orig_path = path
if not path.startswith(self._spacer_dirs[0] + os.path.sep):
raise InvalidPath(path, self._spacer_dirs[0])
for spacer in self._spacer_dirs:
if not path.startswith(spacer + os.path.sep):
break
- id = path[len(spacer)+1:]
- fields = path[len(spacer)+1:].split(os.path.sep,1)
+ id = path[len(spacer + os.path.sep):]
+ fields = path[len(spacer + os.path.sep):].split(os.path.sep,1)
if len(fields) == 1:
break
path = fields[1]