util.opener already create the base directory if it doesn't exist
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Fri, 28 Oct 2005 11:01:25 -0700
changeset 1477 d3566eda2bcb
parent 1476 17e8c70fb670
child 1478 e6dd91a88b57
util.opener already create the base directory if it doesn't exist
mercurial/localrepo.py
--- 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: