Changeset a13e3aba2ab2…
Parent 69510f1131aa…
by
Changes to 2 files · Browse files at a13e3aba2ab2 Showing diff from parent 69510f1131aa Diff from another changeset...
@@ -172,10 +172,14 @@ repo = self.get_repo_for_path(cwd)
if repo:
menus = self.menu.get_commands(repo, cwd, files)
+ if cwd == repo.root:
+ cwd_rel = ''
+ else:
+ cwd_rel = cwd[len(repo.root+os.sep):] + os.sep
for f in files:
cpath = util.canonpath(repo.root, cwd, f)
- if cpath.startswith(cwd):
- cpath = cpath[len(cwd+os.sep):]
+ if cpath.startswith(cwd_rel):
+ cpath = cpath[len(cwd_rel):]
self.files.append(cpath)
else:
self.files.append(f)
|
@@ -213,10 +213,11 @@ if self.repo:
# Convert filenames to be relative to cwd
files = []
+ cwd_rel = cwd[len(repo.root+os.sep):]
for f in self.fnames:
cpath = util.canonpath(self.repo.root, cwd, f)
- if cpath.startswith(cwd):
- cpath = cpath[len(cwd+os.sep):]
+ if cpath.startswith(cwd_rel):
+ cpath = cpath[len(cwd_rel):]
files.append(cpath)
else:
files.append(f)
|
Loading...