mq: do not fail if directory to create exists
authorVadim Gelfer <vadim.gelfer@gmail.com>
Tue, 18 Apr 2006 14:56:54 -0700
changeset 2086 8742352db413
parent 2071 67a0a3852024
child 2087 19fcc2889bad
mq: do not fail if directory to create exists
hgext/mq.py
--- a/hgext/mq.py	Thu Apr 13 17:42:49 2006 -0700
+++ b/hgext/mq.py	Tue Apr 18 14:56:54 2006 -0700
@@ -625,7 +625,10 @@
             try:
                 repo.wfile(f, "w").write(t)
             except IOError:
-                os.makedirs(os.path.dirname(repo.wjoin(f)))
+                try:
+                    os.makedirs(os.path.dirname(repo.wjoin(f)))
+                except OSError, err:
+                    if err.errno != errno.EEXIST: raise
                 repo.wfile(f, "w").write(t)
 
         if not wlock: