Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

rename: fixes for context menu usage

Changeset d678478ed5c2

Parent e15597258047

by Steve Borho

Changes to 3 files · Browse files at d678478ed5c2 Showing diff from parent e15597258047 Diff from another changeset...

Change 1 of 4 Show Entire File hggtk/​rename.py Stacked
 
365
366
367
368
 
369
370
371
 
378
379
380
 
 
 
 
381
382
383
 
395
396
397
398
 
399
400
401
 
414
415
416
417
 
418
419
420
 
365
366
367
 
368
369
370
371
 
378
379
380
381
382
383
384
385
386
387
 
399
400
401
 
402
403
404
405
 
418
419
420
 
421
422
423
424
@@ -365,7 +365,7 @@
  line = diffexpand(line)   buf.insert(bufiter, line)   -def run(files = [], detect=False, root='', **opts): +def run(files = [], detect=False, root='', cwd='', **opts):   fname, target = '', ''   try:   fname = files[0] @@ -378,6 +378,10 @@
  dialog.connect('destroy', gtk.main_quit)   else:   from dialog import entry_dialog + if cwd: os.chdir(cwd) + fname = util.normpath(fname) + if target: + target = util.normpath(target)   title = 'Rename ' + fname   dialog = entry_dialog(None, title, True, target or fname, rename_resp)   dialog.orig = fname @@ -395,7 +399,7 @@
  try:   root = rootpath()   repo = hg.repository(ui.ui(), root) - except ImportError, RepoError: + except (ImportError, RepoError):   gtk.main_quit()   return   @@ -414,7 +418,7 @@
  try:   commands.rename(repo.ui, repo, dialog.orig, new_name, **opts)   toquit = True - except util.Abort, inst: + except (util.Abort, RepoError), inst:   error_dialog(None, 'rename error', str(inst))   toquit = False   finally:
Change 1 of 1 Show Entire File hgproc.py Stacked
 
56
57
58
59
 
60
61
62
 
56
57
58
 
59
60
61
62
@@ -56,7 +56,7 @@
 def get_option(args):   import getopt   long_opt_list = ('command=', 'exepath=', 'listfile=', 'root=', 'cwd=', - 'deletelistfile', 'nogui') + 'deletelistfile', 'nogui', 'detect')   opts, args = getopt.getopt(args, "c:e:l:dR:", long_opt_list)   # Set default options   options = {}
 
576
577
578
579
 
 
 
 
 
580
581
 
582
583
584
585
 
586
587
588
 
576
577
578
 
579
580
581
582
583
584
 
585
586
587
588
 
589
590
591
592
@@ -576,13 +576,17 @@
    def _rename(self, parent_window):   src = self._filenames[0] - root = self._folder + if self._folder: + cwd = self._folder + elif self._filenames: + f = self._filenames[0] + cwd = os.path.isdir(f) and f or os.path.dirname(f)   cmdopts = "--verbose" - open_dialog('rename', cmdopts, root, filelist=[src]) + open_dialog('rename', cmdopts, cwd=cwd, filelist=[src])     def _guess_rename(self, parent_window):   root = self._folder - open_dialog('rename', '--detect', root) + open_dialog('rename --detect', None, root)     def _status(self, parent_window):   self._run_dialog('status')