[PATCH 1 of 2] Fix misleading abort message when permissions are bad

Eric Hopper hopper at omnifarious.org
Mon Sep 26 16:45:47 CDT 2005


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Node ID d8194057f6dca0b18d53bbb9c0e26a48981d9169
# Parent  3729e2773cca26a4c76a60e903a55b034e64ad89
Fix misleading abort message when permissions are bad.

diff -r 3729e2773cca -r d8194057f6dc mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Sep 26 21:01:18 2005
+++ b/mercurial/localrepo.py	Mon Sep 26 21:37:30 2005
@@ -9,7 +9,7 @@
 import filelog, manifest, changelog, dirstate, repo
 from node import *
 from demandload import *
-demandload(globals(), "re lock transaction tempfile stat mdiff")
+demandload(globals(), "re lock transaction tempfile stat mdiff errno")
 
 class localrepository:
     def __init__(self, ui, path=None, create=0):
@@ -1221,7 +1221,9 @@
             t = self.file(f).read(get[f])
             try:
                 self.wwrite(f, t)
-            except IOError:
+            except IOError, e:
+                if e.errno != errno.ENOENT:
+                    raise
                 os.makedirs(os.path.dirname(self.wjoin(f)))
                 self.wwrite(f, t)
             util.set_exec(self.wjoin(f), mf2[f])


More information about the Mercurial mailing list