changeset 7179:3d080733a339

merge with crew-stable
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 19 Oct 2008 22:07:43 +0200
parents 09ed32b79656 (current diff) 98b6c3dde237 (diff)
children a42d27bc809d
files mercurial/statichttprepo.py
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/statichttprepo.py	Sun Oct 19 16:31:24 2008 +0200
+++ b/mercurial/statichttprepo.py	Sun Oct 19 22:07:43 2008 +0200
@@ -42,11 +42,18 @@
         try:
             requirements = self.opener("requires").read().splitlines()
         except IOError, inst:
-            if inst.errno == errno.ENOENT:
+            if inst.errno != errno.ENOENT:
+                raise
+            # check if it is a non-empty old-style repository
+            try:
+                self.opener("00changelog.i").read(1)
+            except IOError, inst:
+                if inst.errno != errno.ENOENT:
+                    raise
+                # we do not care about empty old-style repositories here
                 msg = _("'%s' does not appear to be an hg repository") % path
                 raise repo.RepoError(msg)
-            else:
-                requirements = []
+            requirements = []
 
         # check them
         for r in requirements: