Show More
@@ -176,11 +176,11 b' class queue:' | |||||
176 | if exactneg: |
|
176 | if exactneg: | |
177 | return False, exactneg[0] |
|
177 | return False, exactneg[0] | |
178 | pos = [g for g in patchguards if g[0] == '+'] |
|
178 | pos = [g for g in patchguards if g[0] == '+'] | |
179 |
|
|
179 | exactpos = [g for g in pos if g[1:] in guards] | |
180 | if pos: |
|
180 | if pos: | |
181 |
if |
|
181 | if exactpos: | |
182 |
return True, |
|
182 | return True, exactpos[0] | |
183 |
return False, |
|
183 | return False, pos | |
184 | return True, '' |
|
184 | return True, '' | |
185 |
|
185 | |||
186 | def explain_pushable(self, idx, all_patches=False): |
|
186 | def explain_pushable(self, idx, all_patches=False): | |
@@ -1742,7 +1742,7 b' def select(ui, repo, *args, **opts):' | |||||
1742 |
|
1742 | |||
1743 | this sets "stable" guard. mq will skip foo.patch (because it has |
|
1743 | this sets "stable" guard. mq will skip foo.patch (because it has | |
1744 | nagative match) but push bar.patch (because it has posative |
|
1744 | nagative match) but push bar.patch (because it has posative | |
1745 |
match). patch is pushed |
|
1745 | match). patch is pushed if any posative guards match and no | |
1746 | nagative guards match. |
|
1746 | nagative guards match. | |
1747 |
|
1747 | |||
1748 | with no arguments, default is to print current active guards. |
|
1748 | with no arguments, default is to print current active guards. |
@@ -63,25 +63,39 b' echo % should push all' | |||||
63 | hg qpush -a |
|
63 | hg qpush -a | |
64 |
|
64 | |||
65 | hg qpop -a |
|
65 | hg qpop -a | |
66 |
hg qguard a.patch +1 |
|
66 | hg qguard a.patch +1 | |
|
67 | hg qguard b.patch +2 | |||
67 | hg qselect 1 |
|
68 | hg qselect 1 | |
|
69 | echo % should push a.patch, not b.patch | |||
|
70 | hg qpush | |||
|
71 | hg qpush | |||
|
72 | hg qpop -a | |||
|
73 | ||||
|
74 | hg qselect 2 | |||
68 | echo % should push b.patch |
|
75 | echo % should push b.patch | |
69 | hg qpush |
|
76 | hg qpush | |
70 | hg qpop -a |
|
77 | hg qpop -a | |
71 |
|
78 | |||
72 | hg qselect 2 |
|
79 | hg qselect 1 2 | |
|
80 | echo % should push a.patch, b.patch | |||
73 | hg qpush |
|
81 | hg qpush | |
74 | hg qpop -a |
|
|||
75 |
|
||||
76 | hg qselect 1 2 |
|
|||
77 | echo % should push a.patch |
|
|||
78 | hg qpush |
|
82 | hg qpush | |
79 | hg qpop -a |
|
83 | hg qpop -a | |
80 |
|
84 | |||
81 | hg qguard a.patch +1 +2 -3 |
|
85 | hg qguard a.patch +1 +2 -3 | |
82 | hg qselect 1 2 3 |
|
86 | hg qselect 1 2 3 | |
|
87 | echo % list patches and guards | |||
|
88 | hg qguard -l | |||
|
89 | echo % list series | |||
|
90 | hg qseries -v | |||
|
91 | echo % list guards | |||
|
92 | hg qselect | |||
83 | echo % should push b.patch |
|
93 | echo % should push b.patch | |
84 | hg qpush |
|
94 | hg qpush | |
85 |
|
95 | |||
86 | hg qpush -a |
|
96 | hg qpush -a | |
87 | hg qselect -n --reapply |
|
97 | hg qselect -n --reapply | |
|
98 | echo % guards in series file: +1 +2 -3 | |||
|
99 | hg qselect -s | |||
|
100 | echo % should show c.patch | |||
|
101 | hg qapplied |
@@ -34,19 +34,37 b' applying b.patch' | |||||
34 | applying c.patch |
|
34 | applying c.patch | |
35 | Now at: c.patch |
|
35 | Now at: c.patch | |
36 | Patch queue now empty |
|
36 | Patch queue now empty | |
|
37 | number of unguarded, unapplied patches has changed from 1 to 2 | |||
|
38 | % should push a.patch, not b.patch | |||
|
39 | applying a.patch | |||
|
40 | Now at: a.patch | |||
|
41 | applying c.patch | |||
|
42 | Now at: c.patch | |||
|
43 | Patch queue now empty | |||
37 | % should push b.patch |
|
44 | % should push b.patch | |
38 | applying b.patch |
|
45 | applying b.patch | |
39 | Now at: b.patch |
|
46 | Now at: b.patch | |
40 | Patch queue now empty |
|
47 | Patch queue now empty | |
|
48 | number of unguarded, unapplied patches has changed from 2 to 3 | |||
|
49 | % should push a.patch, b.patch | |||
|
50 | applying a.patch | |||
|
51 | Now at: a.patch | |||
41 | applying b.patch |
|
52 | applying b.patch | |
42 | Now at: b.patch |
|
53 | Now at: b.patch | |
43 | Patch queue now empty |
|
54 | Patch queue now empty | |
44 | number of unguarded, unapplied patches has changed from 2 to 3 |
|
|||
45 | % should push a.patch |
|
|||
46 | applying a.patch |
|
|||
47 | Now at: a.patch |
|
|||
48 | Patch queue now empty |
|
|||
49 | number of unguarded, unapplied patches has changed from 3 to 2 |
|
55 | number of unguarded, unapplied patches has changed from 3 to 2 | |
|
56 | % list patches and guards | |||
|
57 | a.patch: +1 +2 -3 | |||
|
58 | b.patch: +2 | |||
|
59 | c.patch: unguarded | |||
|
60 | % list series | |||
|
61 | 0 G a.patch | |||
|
62 | 1 U b.patch | |||
|
63 | 2 U c.patch | |||
|
64 | % list guards | |||
|
65 | 1 | |||
|
66 | 2 | |||
|
67 | 3 | |||
50 | % should push b.patch |
|
68 | % should push b.patch | |
51 | applying b.patch |
|
69 | applying b.patch | |
52 | Now at: b.patch |
|
70 | Now at: b.patch | |
@@ -56,6 +74,11 b' guards deactivated' | |||||
56 | popping guarded patches |
|
74 | popping guarded patches | |
57 | Patch queue now empty |
|
75 | Patch queue now empty | |
58 | reapplying unguarded patches |
|
76 | reapplying unguarded patches | |
59 | applying b.patch |
|
|||
60 | applying c.patch |
|
77 | applying c.patch | |
61 | Now at: c.patch |
|
78 | Now at: c.patch | |
|
79 | % guards in series file: +1 +2 -3 | |||
|
80 | +1 | |||
|
81 | +2 | |||
|
82 | -3 | |||
|
83 | % should show c.patch | |||
|
84 | c.patch |
General Comments 0
You need to be logged in to leave comments.
Login now