hgext/mq.py
branchstable
changeset 10691 a778a367c20b
parent 10690 ea85c01c7835
child 10692 2a6c34b14ace
child 10730 4d6bd7b8b6d8
--- a/hgext/mq.py	Sun Mar 14 19:21:24 2010 +0100
+++ b/hgext/mq.py	Sun Mar 14 18:46:38 2010 +0100
@@ -2633,7 +2633,16 @@
     if not mq:
         return orig(ui, *args, **kwargs)
 
-    repopath = cmdutil.findrepo(os.getcwd())
+    if args:
+        repopath = args[0]
+        if not hg.islocal(repopath):
+            raise util.Abort(_('only a local queue repository '
+                               'may be initialized'))
+    else:
+        repopath = cmdutil.findrepo(os.getcwd())
+        if not repopath:
+            raise util.Abort(_('There is no Mercurial repository here '
+                               '(.hg not found)'))
     repo = hg.repository(ui, repopath)
     return qinit(ui, repo, True)