convert/mtn: avoid unnecessary initial test of mtn repo
authorDaniel Atallah <daniel.atallah@gmail.com>
Fri, 25 Mar 2011 10:13:46 -0400
changeset 13761 aeb41f0048e7
parent 13760 ed97955e0c04
child 13762 3740792dbe51
convert/mtn: avoid unnecessary initial test of mtn repo As soon as before() is called, we'll know if there is a problem (and get a better error message).
hgext/convert/monotone.py
--- a/hgext/convert/monotone.py	Wed Mar 23 14:26:56 2011 -0400
+++ b/hgext/convert/monotone.py	Fri Mar 25 10:13:46 2011 -0400
@@ -20,6 +20,7 @@
         self.ui = ui
         self.path = path
         self.automatestdio = False
+        self.rev = rev
 
         norepo = NoRepo(_("%s does not look like a monotone repository")
                         % path)
@@ -65,14 +66,6 @@
 
         checktool('mtn', abort=False)
 
-        # test if there are any revisions
-        self.rev = None
-        try:
-            self.getheads()
-        except:
-            raise norepo
-        self.rev = rev
-
     def mtnrun(self, *args, **kwargs):
         if self.automatestdio:
             return self.mtnrunstdio(*args, **kwargs)