diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ clean: find contrib doc hgext i18n mercurial tests \ \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';' rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py))) - rm -f MANIFEST MANIFEST.in mercurial/__version__.py tests/*.err + rm -f MANIFEST MANIFEST.in mercurial/__version__.py hgext/__index__.py tests/*.err rm -rf build mercurial/locale $(MAKE) -C doc clean diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -281,7 +281,7 @@ def disabled(): return dict((name, gettext(desc)) for name, desc in __index__.docs.iteritems() if name not in _order) - except ImportError: + except (ImportError, AttributeError): pass paths = _disabledpaths() @@ -304,7 +304,7 @@ def disabledext(name): return else: return gettext(__index__.docs.get(name)) - except ImportError: + except (ImportError, AttributeError): pass paths = _disabledpaths() diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -331,7 +331,9 @@ class buildhgextindex(Command): def run(self): if os.path.exists(self._indexfilename): - os.unlink(self._indexfilename) + f = open(self._indexfilename, 'w') + f.write('# empty\n') + f.close() # here no extension enabled, disabled() lists up everything code = ('import pprint; from mercurial import extensions; '