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: create subdirectories when necessary

Changeset cdeecb498a56

Parent a42ac062d37d

by Steve Borho

Changes to one file · Browse files at cdeecb498a56 Showing diff from parent a42ac062d37d Diff from another changeset...

 
9
10
11
 
12
13
14
 
65
66
67
68
 
 
 
 
69
70
71
 
72
73
74
 
9
10
11
12
13
14
15
 
66
67
68
 
69
70
71
72
73
74
 
75
76
77
78
@@ -9,6 +9,7 @@
 import sys  import gtk  import cStringIO +import shutil    from mercurial import hg, ui, util, commands   @@ -65,10 +66,13 @@
  repo.ui.quiet = True   try:   new_name = util.canonpath(root, root, new_name) - os.rename(dlg.orig, new_name) + targetdir = os.path.dirname(new_name) or '.' + if not os.path.isdir(targetdir): + os.makedirs(targetdir) + util.copyfile(dlg.orig, new_name)   commands.rename(repo.ui, repo, dlg.orig, new_name, **opts)   toquit = True - except (OSError, util.Abort, hglib.RepoError), inst: + except (OSError, IOError, util.Abort, hglib.RepoError), inst:   dialog.error_dialog(None, _('rename error'), str(inst))   toquit = False   finally: