Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

cmenu: better relative path algorithm

Changeset 0272052c9684

Parent a93ecb406a4b

by Steve Borho

Changes to 2 files · Browse files at 0272052c9684 Showing diff from parent a93ecb406a4b Diff from another changeset...

 
165
166
167
168
 
 
 
 
 
 
169
170
171
 
165
166
167
 
168
169
170
171
172
173
174
175
176
@@ -165,7 +165,12 @@
  if repo:   menus = self.menu.get_commands(repo, cwd, files)   for f in files: - self.files.append(util.canonpath(repo.root, cwd, f)) + cpath = util.canonpath(repo.root, cwd, f) + if cpath.startswith(cwd): + cpath = cpath[len(cwd+os.sep):] + self.files.append(cpath) + else: + self.files.append(f)   else:   menus = self.menu.get_norepo_commands(cwd, files)   self.cwd = cwd
 
210
211
212
213
 
 
 
 
 
 
214
215
216
 
210
211
212
 
213
214
215
216
217
218
219
220
221
@@ -210,7 +210,12 @@
  # Convert filenames to be relative to cwd   files = []   for f in self.fnames: - files.append(util.canonpath(self.repo.root, cwd, f)) + cpath = util.canonpath(self.repo.root, cwd, f) + if cpath.startswith(cwd): + cpath = cpath[len(cwd+os.sep):] + files.append(cpath) + else: + files.append(f)   self.fnames = files   gpopts = "--command %s " % hgcmd   if filelist: