##// END OF EJS Templates
mq: fix init with nonexistent or non-local repository
Cédric Duval -
r10691:a778a367 stable
parent child Browse files
Show More
@@ -2633,7 +2633,16 b' def mqinit(orig, ui, *args, **kwargs):'
2633 if not mq:
2633 if not mq:
2634 return orig(ui, *args, **kwargs)
2634 return orig(ui, *args, **kwargs)
2635
2635
2636 repopath = cmdutil.findrepo(os.getcwd())
2636 if args:
2637 repopath = args[0]
2638 if not hg.islocal(repopath):
2639 raise util.Abort(_('only a local queue repository '
2640 'may be initialized'))
2641 else:
2642 repopath = cmdutil.findrepo(os.getcwd())
2643 if not repopath:
2644 raise util.Abort(_('There is no Mercurial repository here '
2645 '(.hg not found)'))
2637 repo = hg.repository(ui, repopath)
2646 repo = hg.repository(ui, repopath)
2638 return qinit(ui, repo, True)
2647 return qinit(ui, repo, True)
2639
2648
@@ -80,6 +80,19 b" echo ' series:'"
80 cat .hg/patches/series
80 cat .hg/patches/series
81 cd ..
81 cd ..
82
82
83 echo '% init --mq without repo'
84 mkdir f
85 cd f
86 hg init --mq
87 cd ..
88
89 echo '% init --mq with nonexistent directory'
90 hg init --mq nonexistentdir
91
92 echo '% init --mq with bundle (non "local")'
93 hg -R a bundle --all a.bundle >/dev/null
94 hg init --mq a.bundle
95
83 cd a
96 cd a
84
97
85 hg qnew -m 'foo bar' test.patch
98 hg qnew -m 'foo bar' test.patch
@@ -89,6 +89,12 b' bleh'
89 series:
89 series:
90 A
90 A
91 B
91 B
92 % init --mq without repo
93 abort: There is no Mercurial repository here (.hg not found)
94 % init --mq with nonexistent directory
95 abort: repository nonexistentdir not found!
96 % init --mq with bundle (non "local")
97 abort: only a local queue repository may be initialized
92 % qrefresh
98 % qrefresh
93 foo bar
99 foo bar
94
100
General Comments 0
You need to be logged in to leave comments. Login now