changeset 1477:d3566eda2bcb

util.opener already create the base directory if it doesn't exist
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 28 Oct 2005 11:01:25 -0700
parents 17e8c70fb670
children e6dd91a88b57
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Oct 28 10:57:40 2005 -0700
+++ b/mercurial/localrepo.py	Fri Oct 28 11:01:25 2005 -0700
@@ -565,13 +565,7 @@
                 self.ui.warn("%s not removed!\n" % f)
             else:
                 t = self.file(f).read(m[f])
-                try:
-                    self.wwrite(f, t)
-                except IOError, e:
-                    if e.errno != errno.ENOENT:
-                        raise
-                    os.makedirs(os.path.dirname(self.wjoin(f)))
-                    self.wwrite(f, t)
+                self.wwrite(f, t)
                 util.set_exec(self.wjoin(f), mf[f])
                 self.dirstate.update([f], "n")
 
@@ -1514,13 +1508,7 @@
             if f[0] == "/": continue
             self.ui.note(_("getting %s\n") % f)
             t = self.file(f).read(get[f])
-            try:
-                self.wwrite(f, t)
-            except IOError, e:
-                if e.errno != errno.ENOENT:
-                    raise
-                os.makedirs(os.path.dirname(self.wjoin(f)))
-                self.wwrite(f, t)
+            self.wwrite(f, t)
             util.set_exec(self.wjoin(f), mf2[f])
             if moddirstate:
                 if branch_merge: