by
Changes to 3 files · Browse files at e5b6dc69d36d Showing diff from parent 1ec645c00a96 52ac8fe83a98 Diff from another changeset...
@@ -988,13 +988,16 @@ if self.glog_parent:
# If this changeset browser is embedded in glog, send
# send this event to the main app
- fname = hglib.toutf(self.curfile)
+ path = hglib.escapepath(self.curfile)
+ fname = hglib.toutf(path)
opts = {'pats': [fname]}
- self.glog_parent.filtercombo.set_active(1)
- self.glog_parent.filterentry.set_text(fname)
- self.glog_parent.filterbar.get_button('custom').set_active(True)
- self.glog_parent.filter = 'custom'
- self.glog_parent.reload_log(**opts)
+ explorer = self.glog_parent
+ explorer.filter = 'custom'
+ explorer.filtercombo.set_active(1)
+ explorer.filterentry.set_text(fname)
+ explorer.filterbar.get_button('custom').set_active(True)
+ explorer.filter_entry_activated(explorer.filterentry,
+ explorer.filtercombo)
else:
# Else launch our own glog instance
from tortoisehg.hgtk import history
|
@@ -883,13 +883,15 @@ self.filterbar.get_button('custom').set_active(True)
self.filter = 'custom'
self.filtercombo.set_active(1)
- self.filterentry.set_text(hglib.toutf(opts['filehist']))
+ path = hglib.escapepath(opts['filehist'])
+ self.filterentry.set_text(hglib.toutf(path))
self.filter_entry_activated(self.filterentry, self.filtercombo)
elif self.pats:
self.filterbar.get_button('custom').set_active(True)
self.filter = 'custom'
self.filtercombo.set_active(1)
- self.filterentry.set_text(hglib.toutf(', '.join(self.pats)))
+ paths = [hglib.escapepath(p) for p in self.pats]
+ self.filterentry.set_text(hglib.toutf(', '.join(paths)))
self.filter_entry_activated(self.filterentry, self.filtercombo)
elif 'bundle' in opts:
self.set_bundlefile(opts['bundle'])
|
@@ -219,6 +219,14 @@ canonpats.append(f)
return canonpats
+def escapepath(path):
+ 'Before passing a file path to hg API, it may need escaping'
+ p = path
+ if '[' in p or '{' in p or '*' in p or '?' in p:
+ return 'path:' + p
+ else:
+ return p
+
def normpats(pats):
'Normalize file patterns'
normpats = []
|
Loading...