##// END OF EJS Templates
mq: abort cleanly when invalid patch name is given to qguard
Christian Ebert -
r4133:a9ee6c53 default
parent child Browse files
Show More
@@ -1712,7 +1712,10 b' def guard(ui, repo, *args, **opts):'
1712 1712 if patch is None:
1713 1713 raise util.Abort(_('no patch to work with'))
1714 1714 if args or opts['none']:
1715 q.set_guards(q.find_series(patch), args)
1715 idx = q.find_series(patch)
1716 if idx is None:
1717 raise util.Abort(_('no patch named %s') % patch)
1718 q.set_guards(idx, args)
1716 1719 q.save_dirty()
1717 1720 else:
1718 1721 status(q.series.index(q.lookup(patch)))
@@ -27,6 +27,9 b' hg qrefresh'
27 27 hg qpop -a
28 28
29 29 echo % should fail
30 hg qguard does-not-exist.patch +bleh
31
32 echo % should fail
30 33 hg qguard +fail
31 34
32 35 hg qpush
@@ -1,6 +1,8 b''
1 1 adding x
2 2 Patch queue now empty
3 3 % should fail
4 abort: no patch named does-not-exist.patch
5 % should fail
4 6 abort: no patches applied
5 7 applying a.patch
6 8 Now at: a.patch
General Comments 0
You need to be logged in to leave comments. Login now