Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable rename: perform renames as move, then hg mv -A

By performing rename using os.rename(), we bypass some of Mercurial's safety
checks and allow some non-trivial renames to succeed. It makes our rename
dialog behave closer to a shell rename function.

Closes #687

Changeset 8c6b50b0b175

Parent 7d2f361f410b

by Steve Borho

Changes to one file · Browse files at 8c6b50b0b175 Showing diff from parent 7d2f361f410b Diff from another changeset...

 
5
6
7
 
8
9
10
 
47
48
49
50
 
51
52
53
 
58
59
60
 
61
62
63
 
64
65
66
 
5
6
7
8
9
10
11
 
48
49
50
 
51
52
53
54
 
59
60
61
62
63
64
 
65
66
67
68
@@ -5,6 +5,7 @@
 # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.   +import os  import sys  import gtk  import cStringIO @@ -47,7 +48,7 @@
  new_name = hglib.fromutf(dlg.entry.get_text())   opts = {}   opts['force'] = False # Checkbox? Nah. - opts['after'] = False + opts['after'] = True   opts['dry_run'] = False     saved = sys.stderr @@ -58,9 +59,10 @@
  repo.ui.pushbuffer()   repo.ui.quiet = True   try: + os.rename(dlg.orig, new_name)   commands.rename(repo.ui, repo, dlg.orig, new_name, **opts)   toquit = True - except (util.Abort, hglib.RepoError), inst: + except (OSError, util.Abort, hglib.RepoError), inst:   dlg.error_dialog(None, _('rename error'), str(inst))   toquit = False   finally: