changeset 5653:1b35bc1c1968

patch: simplify directory creation
author Patrick Mezard <pmezard@gmail.com>
date Mon, 17 Dec 2007 23:42:48 +0100
parents e90e72c6b4c7
children 831e34e17f4f dd3ce7515f4d
files mercurial/patch.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Mon Dec 17 23:42:46 2007 +0100
+++ b/mercurial/patch.py	Mon Dec 17 23:42:48 2007 +0100
@@ -321,12 +321,7 @@
         if not self.exists:
             dirname = os.path.dirname(fname)
             if dirname and not os.path.isdir(dirname):
-                dirs = dirname.split(os.path.sep)
-                d = ""
-                for x in dirs:
-                    d = os.path.join(d, x)
-                    if not os.path.isdir(d):
-                        os.mkdir(d)
+                os.makedirs(dirname)
 
         self.hash = {}
         self.dirty = 0