changeset 5522:f5345a2d2391

convert: make sure mercurial_source has a local hg repo
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 09 Nov 2007 20:21:35 -0200
parents 03496d4fa509
children 5db730475d6d
files hgext/convert/hg.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/hg.py	Fri Nov 09 20:21:35 2007 -0200
+++ b/hgext/convert/hg.py	Fri Nov 09 20:21:35 2007 -0200
@@ -187,10 +187,11 @@
             self.repo = hg.repository(self.ui, path)
             # try to provoke an exception if this isn't really a hg
             # repo, but some other bogus compatible-looking url
-            self.repo.heads()
+            if not self.repo.local():
+                raise hg.RepoError()
         except hg.RepoError:
             ui.print_exc()
-            raise NoRepo("%s does not look like a Mercurial repo" % path)
+            raise NoRepo("%s is not a local Mercurial repo" % path)
         self.lastrev = None
         self.lastctx = None
         self._changescache = None