Mercurial > public > mercurial-scm > hg
diff hgext/convert/bzr.py @ 7973:db3a68fd9387
convert: attempt to check repo type before checking for tool
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 04 Apr 2009 12:28:13 -0500 |
parents | 972cce34f345 |
children | ffbebfb6b8d4 |
line wrap: on
line diff
--- a/hgext/convert/bzr.py Sat Apr 04 19:43:00 2009 +0200 +++ b/hgext/convert/bzr.py Sat Apr 04 12:28:13 2009 -0500 @@ -27,15 +27,15 @@ def __init__(self, ui, path, rev=None): super(bzr_source, self).__init__(ui, path, rev=rev) + if not os.path.exists(os.path.join(path, '.bzr')): + raise NoRepo('%s does not look like a Bazaar repo' % path) + try: # access bzrlib stuff branch except NameError: raise NoRepo('Bazaar modules could not be loaded') - if not os.path.exists(os.path.join(path, '.bzr')): - raise NoRepo('%s does not look like a Bazaar repo' % path) - path = os.path.abspath(path) self.branch = branch.Branch.open(path) self.sourcerepo = self.branch.repository