changeset 5918:1716c8a0bd09

convert: mercurial sink must be local
author Patrick Mezard <pmezard@gmail.com>
date Mon, 21 Jan 2008 22:24:28 +0100
parents a8dbfa1802cd
children badf5711bd86
files hgext/convert/hg.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/hg.py	Mon Jan 21 22:00:44 2008 +0100
+++ b/hgext/convert/hg.py	Mon Jan 21 22:24:28 2008 +0100
@@ -24,6 +24,8 @@
         if os.path.isdir(path) and len(os.listdir(path)) > 0:
             try:
                 self.repo = hg.repository(self.ui, path)
+                if not self.repo.local():
+                    raise NoRepo(_('%s is not a local Mercurial repo') % path)
                 ui.status(_('destination %s is a Mercurial repository\n') %
                           path)
             except hg.RepoError, err:
@@ -33,6 +35,8 @@
             try:
                 ui.status(_('initializing destination %s repository\n') % path)
                 self.repo = hg.repository(self.ui, path, create=True)
+                if not self.repo.local():
+                    raise NoRepo(_('%s is not a local Mercurial repo') % path)
                 self.created.append(path)
             except hg.RepoError, err:
                 ui.print_exc()