Commits

Jannis Leidel committed cf78ad1

Fixed stupid mistake with RepoError

Comments (0)

Files changed (2)

 
 setup(
     name="setuptools_hg",
-    version='0.1.5',
+    version='0.2',
     author="Jannis Leidel",
     author_email="jannis@leidel.info",
     url="http://bitbucket.org/jezdez/setuptools_hg/",
 system which uses the Python library by default and falls back to use the
 command line programm hg(1).
 """
-__version__ = '0.1.5'
+__version__ = '0.2'
 __author__ = 'Jannis Leidel'
 __all__ = ['hg_file_finder']
 
 try:
     from mercurial.__version__ import version
     from mercurial import hg, ui, cmdutil
-except Exception, e:
+except:
     hg = None
 
-OLD_VERSIONS = ('1.0', '1.0.1', '1.0.2')
-
 try:
     from mercurial.repo import RepoError
 except:
-    from mercurial.error import RepoError
+    try:
+        from mercurial.error import RepoError
+    except:
+        pass
+
+OLD_VERSIONS = ('1.0', '1.0.1', '1.0.2')
 
 if os.environ.get('HG_SETUPTOOLS_FORCE_CMD', False):
     hg = None
     Use the Mercurial library to recursively find versioned files in dirname.
     """
     try:
-        repo = hg.repository(ui.ui(), path=dirname)
+        try:
+            repo = hg.repository(ui.ui(), path=dirname)
+        except RepoError:
+            return
         # tuple of (modified, added, removed, deleted, unknown, ignored, clean)
         modified, added, removed, deleted, unknown = repo.status()[:5]