Show More
@@ -1712,7 +1712,10 def guard(ui, repo, *args, **opts): | |||||
1712 | if patch is None: |
|
1712 | if patch is None: | |
1713 | raise util.Abort(_('no patch to work with')) |
|
1713 | raise util.Abort(_('no patch to work with')) | |
1714 | if args or opts['none']: |
|
1714 | if args or opts['none']: | |
1715 |
|
|
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 | q.save_dirty() |
|
1719 | q.save_dirty() | |
1717 | else: |
|
1720 | else: | |
1718 | status(q.series.index(q.lookup(patch))) |
|
1721 | status(q.series.index(q.lookup(patch))) |
@@ -27,6 +27,9 hg qrefresh | |||||
27 | hg qpop -a |
|
27 | hg qpop -a | |
28 |
|
28 | |||
29 | echo % should fail |
|
29 | echo % should fail | |
|
30 | hg qguard does-not-exist.patch +bleh | |||
|
31 | ||||
|
32 | echo % should fail | |||
30 | hg qguard +fail |
|
33 | hg qguard +fail | |
31 |
|
34 | |||
32 | hg qpush |
|
35 | hg qpush |
@@ -1,6 +1,8 | |||||
1 | adding x |
|
1 | adding x | |
2 | Patch queue now empty |
|
2 | Patch queue now empty | |
3 | % should fail |
|
3 | % should fail | |
|
4 | abort: no patch named does-not-exist.patch | |||
|
5 | % should fail | |||
4 | abort: no patches applied |
|
6 | abort: no patches applied | |
5 | applying a.patch |
|
7 | applying a.patch | |
6 | Now at: a.patch |
|
8 | Now at: a.patch |
General Comments 0
You need to be logged in to leave comments.
Login now