Changeset 23a57e67af3d…
Parent fb5b3786bf3f…
by
Changes to 3 files · Browse files at 23a57e67af3d Showing diff from parent fb5b3786bf3f Diff from another changeset...
@@ -206,7 +206,7 @@ if self.opts['addremove']:
cmdline += ['--addremove']
cmdline += ['--message', self.opts['message']]
- cmdline += files
+ cmdline += [self.repo.wjoin(x) for x in files]
dialog = CmdDialog(cmdline, True)
dialog.set_transient_for(self)
dialog.run()
|
@@ -350,18 +350,10 @@ self.load_settings(settings)
- def restore_cwd(self):
- # extdiff works on relative directories to avoid showing temp paths. Since another thread
- # could be running that changed cwd, we always need to set it back. This is a race condition
- # but not likely to be a problem.
- os.chdir(self.repo.root)
-
-
def _hg_call_wrapper(self, title, command, showoutput=True):
"""Run the specified command and display any resulting aborts, messages,
and errors
"""
- self.restore_cwd()
textout = ''
saved = sys.stderr
errors = StringIO.StringIO()
@@ -388,9 +380,8 @@
def _diff_file(self, stat, file):
def dodiff():
- self.restore_cwd()
extdiff.dodiff(self.ui, self.repo, self.diffcmd, [self.diffopts],
- [file], self.opts)
+ [self.repo.wjoin(file)], self.opts)
if self.diffcmd == 'diff':
Prompt('No visual diff configured',
|
@@ -306,7 +306,6 @@ """Clear out the existing ListStore model and reload it from the repository status.
Also recheck and reselect files that remain in the list.
"""
- self.restore_cwd()
self.repo.dirstate.invalidate()
self.repo.invalidate()
@@ -439,6 +438,7 @@
def _hg_remove(self, files):
+ wfiles = [self.repo.wjoin(x) for x in files]
if self.count_revs() > 1:
Prompt('Nothing Removed', 'Remove is not enabled when multiple revisions are specified.', self).run()
return
@@ -446,7 +446,7 @@ # Create new opts, so nothing unintented gets through
removeopts = self.merge_opts(commands.table['^remove|rm'][1], ('include', 'exclude'))
def dohgremove():
- commands.remove(self.ui, self.repo, *files, **removeopts)
+ commands.remove(self.ui, self.repo, *wfiles, **removeopts)
success, outtext = self._hg_call_wrapper('Remove', dohgremove)
if success:
self.reload_status()
@@ -455,11 +455,11 @@ def _tree_selection_changed(self, selection, force):
''' Update the diff text '''
def dohgdiff():
- self.restore_cwd()
difftext = StringIO.StringIO()
try:
if len(files) != 0:
- fns, matchfn, anypats = cmdutil.matchpats(self.repo, files, self.opts)
+ wfiles = [self.repo.wjoin(x) for x in files]
+ fns, matchfn, anypats = cmdutil.matchpats(self.repo, wfiles, self.opts)
patch.diff(self.repo, self._node1, self._node2, fns, match=matchfn,
fp=difftext, opts=patch.diffopts(self.ui, self.opts))
@@ -563,6 +563,7 @@
def _hg_revert(self, files):
+ wfiles = [self.repo.wjoin(x) for x in files]
if self.count_revs() > 1:
Prompt('Nothing Reverted', 'Revert is not enabled when multiple revisions are specified.', self).run()
return
@@ -572,7 +573,7 @@ key = '^revert' in commands.table and '^revert' or 'revert'
revertopts = self.merge_opts(commands.table[key][1], ('include', 'exclude', 'rev'))
def dohgrevert():
- commands.revert(self.ui, self.repo, *files, **revertopts)
+ commands.revert(self.ui, self.repo, *wfiles, **revertopts)
# TODO: Ask which revision when multiple parents (currently just shows abort message)
# TODO: Don't need to prompt when reverting added or removed files
@@ -585,7 +586,7 @@ if dialog.run() == gtk.RESPONSE_YES:
success, outtext = self._hg_call_wrapper('Revert', dohgrevert)
if success:
- shell_notify(files)
+ shell_notify(wfiles)
self.reload_status()
def _add_clicked(self, toolbutton, data=None):
@@ -603,13 +604,14 @@
def _hg_add(self, files):
+ wfiles = [self.repo.wjoin(x) for x in files]
# Create new opts, so nothing unintented gets through
addopts = self.merge_opts(commands.table['^add'][1], ('include', 'exclude'))
def dohgadd():
- commands.add(self.ui, self.repo, *files, **addopts)
+ commands.add(self.ui, self.repo, *wfiles, **addopts)
success, outtext = self._hg_call_wrapper('Add', dohgadd)
if success:
- shell_notify(files)
+ shell_notify(wfiles)
self.reload_status()
|
Loading...