Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc1, 0.4rc2, and 0.4rc3

hggtk: remove chdir hack in commit and status dialogs

this fixes SF bug #1902446: "Commit claims file not under root
while kdiff (via extdiff) is open".

the chdir hack caused the commit function to pick up the temp files
created by extdiff.

Changeset 23a57e67af3d

Parent fb5b3786bf3f

by TK Soh

Changes to 3 files · Browse files at 23a57e67af3d Showing diff from parent fb5b3786bf3f Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​commit.py Stacked
 
206
207
208
209
 
210
211
212
 
206
207
208
 
209
210
211
212
@@ -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()
Change 1 of 2 Show Entire File hggtk/​gdialog.py Stacked
 
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
 
388
389
390
391
392
393
 
394
395
396
 
350
351
352
 
 
 
 
 
 
 
353
354
355
356
 
357
358
359
 
380
381
382
 
383
 
384
385
386
387
@@ -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',
Change 1 of 8 Show Entire File hggtk/​status.py Stacked
 
306
307
308
309
310
311
312
 
439
440
441
 
442
443
444
 
446
447
448
449
 
450
451
452
 
455
456
457
458
459
460
461
462
 
 
463
464
465
 
563
564
565
 
566
567
568
 
572
573
574
575
 
576
577
578
 
585
586
587
588
 
589
590
591
 
603
604
605
 
606
607
608
609
 
610
611
612
 
613
614
615
 
306
307
308
 
309
310
311
 
438
439
440
441
442
443
444
 
446
447
448
 
449
450
451
452
 
455
456
457
 
458
459
460
 
461
462
463
464
465
 
563
564
565
566
567
568
569
 
573
574
575
 
576
577
578
579
 
586
587
588
 
589
590
591
592
 
604
605
606
607
608
609
610
 
611
612
613
 
614
615
616
617
@@ -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()