##// END OF EJS Templates
mq: apply patch is any posative guard matches...
Vadim Gelfer -
r2850:851b07ec default
parent child Browse files
Show More
@@ -176,11 +176,11 b' class queue:'
176 176 if exactneg:
177 177 return False, exactneg[0]
178 178 pos = [g for g in patchguards if g[0] == '+']
179 nonpos = [g for g in pos if g[1:] not in guards]
179 exactpos = [g for g in pos if g[1:] in guards]
180 180 if pos:
181 if not nonpos:
182 return True, ''
183 return False, nonpos
181 if exactpos:
182 return True, exactpos[0]
183 return False, pos
184 184 return True, ''
185 185
186 186 def explain_pushable(self, idx, all_patches=False):
@@ -1742,7 +1742,7 b' def select(ui, repo, *args, **opts):'
1742 1742
1743 1743 this sets "stable" guard. mq will skip foo.patch (because it has
1744 1744 nagative match) but push bar.patch (because it has posative
1745 match). patch is pushed only if all posative guards match and no
1745 match). patch is pushed if any posative guards match and no
1746 1746 nagative guards match.
1747 1747
1748 1748 with no arguments, default is to print current active guards.
@@ -63,25 +63,39 b' echo % should push all'
63 63 hg qpush -a
64 64
65 65 hg qpop -a
66 hg qguard a.patch +1 +2
66 hg qguard a.patch +1
67 hg qguard b.patch +2
67 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 75 echo % should push b.patch
69 76 hg qpush
70 77 hg qpop -a
71 78
72 hg qselect 2
79 hg qselect 1 2
80 echo % should push a.patch, b.patch
73 81 hg qpush
74 hg qpop -a
75
76 hg qselect 1 2
77 echo % should push a.patch
78 82 hg qpush
79 83 hg qpop -a
80 84
81 85 hg qguard a.patch +1 +2 -3
82 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 93 echo % should push b.patch
84 94 hg qpush
85 95
86 96 hg qpush -a
87 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 34 applying c.patch
35 35 Now at: c.patch
36 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 44 % should push b.patch
38 45 applying b.patch
39 46 Now at: b.patch
40 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 52 applying b.patch
42 53 Now at: b.patch
43 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 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 68 % should push b.patch
51 69 applying b.patch
52 70 Now at: b.patch
@@ -56,6 +74,11 b' guards deactivated'
56 74 popping guarded patches
57 75 Patch queue now empty
58 76 reapplying unguarded patches
59 applying b.patch
60 77 applying c.patch
61 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