[PATCH] hgwebdir: handle IOErrors from localrepo while enumerating

timeless timeless at gmail.com
Tue Mar 29 11:38:04 CDT 2011


# HG changeset patch
# User timeless at gmail.com
# Date 1301416390 0
# Node ID defe3f1090e83f1beb26386712f70973f0422dcf
# Parent  ba58c5a615038ac661a3fdedf127b61b3c4963f4
hgwebdir: handle IOErrors from localrepo while enumerating

Repository() raises a number of IOErrors in addition to RepoErrors.
 these are just as uninteresting as RepoErrors and should be ignored

The easiest case of this is a repo whose .hg/ directory is -rx

diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -251,6 +251,9 @@ class hgwebdir(object):
                 # update time with local timezone
                 try:
                     r = hg.repository(self.ui, path)
+                except IOError:
+                    u.warn(_('error accessing repository at %s\n') % path)
+                    continue
                 except error.RepoError:
                     u.warn(_('error accessing repository at %s\n') % path)
                     continue


More information about the Mercurial-devel mailing list