# HG changeset patch # User Thomas Arendsen Hein # Date 1224438596 -7200 # Node ID 98b6c3dde237d7688fb4c577bc0f851bbd257ca0 # Parent 967adcf5910da0b456a8db404154670dedf11ca8 Fix Debian bug #494889 (fetching from static-http://... broken) Changeset 6605a03cbf87 which fixed issue965 (hg clone static-http does not work for empty repos) broke cloning of repos with old layout (without store) via static-http. This fix makes cloning from old-style repositories possible again, but will not allow cloning of empty old-style repositories as this can not be detected reliably. diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py +++ b/mercurial/statichttprepo.py @@ -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: