Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 5653:1b35bc1c1968
patch: simplify directory creation
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 17 Dec 2007 23:42:48 +0100 |
parents | e90e72c6b4c7 |
children | 1127fe12202a |
comparison
equal
deleted
inserted
replaced
5652:e90e72c6b4c7 | 5653:1b35bc1c1968 |
---|---|
319 self.ui.warn(_("unable to find '%s' for patching\n") % self.fname) | 319 self.ui.warn(_("unable to find '%s' for patching\n") % self.fname) |
320 | 320 |
321 if not self.exists: | 321 if not self.exists: |
322 dirname = os.path.dirname(fname) | 322 dirname = os.path.dirname(fname) |
323 if dirname and not os.path.isdir(dirname): | 323 if dirname and not os.path.isdir(dirname): |
324 dirs = dirname.split(os.path.sep) | 324 os.makedirs(dirname) |
325 d = "" | |
326 for x in dirs: | |
327 d = os.path.join(d, x) | |
328 if not os.path.isdir(d): | |
329 os.mkdir(d) | |
330 | 325 |
331 self.hash = {} | 326 self.hash = {} |
332 self.dirty = 0 | 327 self.dirty = 0 |
333 self.offset = 0 | 328 self.offset = 0 |
334 self.rej = [] | 329 self.rej = [] |