Show More
@@ -1,79 +1,210 b'' | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | 1 | # Test the plumbing of mq.git option |
|
4 | 2 | # Automatic upgrade itself is tested elsewhere. |
|
5 | 3 | |
|
6 | echo "[extensions]" >> $HGRCPATH | |
|
7 | echo "mq=" >> $HGRCPATH | |
|
8 | echo "[diff]" >> $HGRCPATH | |
|
9 | echo "nodates=1" >> $HGRCPATH | |
|
4 | $ echo "[extensions]" >> $HGRCPATH | |
|
5 | $ echo "mq=" >> $HGRCPATH | |
|
6 | $ echo "[diff]" >> $HGRCPATH | |
|
7 | $ echo "nodates=1" >> $HGRCPATH | |
|
8 | ||
|
9 | $ hg init repo-auto | |
|
10 | $ cd repo-auto | |
|
11 | ||
|
12 | git=auto: regular patch creation: | |
|
13 | ||
|
14 | $ echo a > a | |
|
15 | $ hg add a | |
|
16 | $ hg qnew -d '0 0' -f adda | |
|
17 | ||
|
18 | $ cat .hg/patches/adda | |
|
19 | # HG changeset patch | |
|
20 | # Parent 0000000000000000000000000000000000000000 | |
|
21 | # Date 0 0 | |
|
22 | ||
|
23 | diff -r 000000000000 -r ef8dafc9fa4c a | |
|
24 | --- /dev/null | |
|
25 | +++ b/a | |
|
26 | @@ -0,0 +1,1 @@ | |
|
27 | +a | |
|
28 | ||
|
29 | git=auto: git patch creation with copy: | |
|
30 | ||
|
31 | $ hg cp a b | |
|
32 | $ hg qnew -d '0 0' -f copy | |
|
33 | ||
|
34 | $ cat .hg/patches/copy | |
|
35 | # HG changeset patch | |
|
36 | # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4 | |
|
37 | # Date 0 0 | |
|
38 | ||
|
39 | diff --git a/a b/b | |
|
40 | copy from a | |
|
41 | copy to b | |
|
42 | ||
|
43 | git=auto: git patch when using --git: | |
|
44 | ||
|
45 | $ echo regular > regular | |
|
46 | $ hg add regular | |
|
47 | $ hg qnew -d '0 0' --git -f git | |
|
10 | 48 | |
|
11 | hg init repo-auto | |
|
12 | cd repo-auto | |
|
13 | echo '% git=auto: regular patch creation' | |
|
14 | echo a > a | |
|
15 | hg add a | |
|
16 | hg qnew -d '0 0' -f adda | |
|
17 | cat .hg/patches/adda | |
|
18 | echo '% git=auto: git patch creation with copy' | |
|
19 | hg cp a b | |
|
20 | hg qnew -d '0 0' -f copy | |
|
21 | cat .hg/patches/copy | |
|
22 | echo '% git=auto: git patch when using --git' | |
|
23 | echo regular > regular | |
|
24 | hg add regular | |
|
25 | hg qnew -d '0 0' --git -f git | |
|
26 | cat .hg/patches/git | |
|
27 | echo '% git=auto: regular patch after qrefresh without --git' | |
|
28 | hg qrefresh -d '0 0' | |
|
29 | cat .hg/patches/git | |
|
30 | cd .. | |
|
49 | $ cat .hg/patches/git | |
|
50 | # HG changeset patch | |
|
51 | # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d | |
|
52 | # Date 0 0 | |
|
53 | ||
|
54 | diff --git a/regular b/regular | |
|
55 | new file mode 100644 | |
|
56 | --- /dev/null | |
|
57 | +++ b/regular | |
|
58 | @@ -0,0 +1,1 @@ | |
|
59 | +regular | |
|
60 | ||
|
61 | git=auto: regular patch after qrefresh without --git: | |
|
62 | ||
|
63 | $ hg qrefresh -d '0 0' | |
|
64 | ||
|
65 | $ cat .hg/patches/git | |
|
66 | # HG changeset patch | |
|
67 | # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d | |
|
68 | # Date 0 0 | |
|
69 | ||
|
70 | diff -r 99586d5f048c regular | |
|
71 | --- /dev/null | |
|
72 | +++ b/regular | |
|
73 | @@ -0,0 +1,1 @@ | |
|
74 | +regular | |
|
75 | ||
|
76 | $ cd .. | |
|
77 | ||
|
78 | $ hg init repo-keep | |
|
79 | $ cd repo-keep | |
|
80 | $ echo '[mq]' > .hg/hgrc | |
|
81 | $ echo 'git = KEEP' >> .hg/hgrc | |
|
82 | ||
|
83 | git=keep: git patch with --git: | |
|
84 | ||
|
85 | $ echo a > a | |
|
86 | $ hg add a | |
|
87 | $ hg qnew -d '0 0' -f --git git | |
|
88 | ||
|
89 | $ cat .hg/patches/git | |
|
90 | # HG changeset patch | |
|
91 | # Parent 0000000000000000000000000000000000000000 | |
|
92 | # Date 0 0 | |
|
93 | ||
|
94 | diff --git a/a b/a | |
|
95 | new file mode 100644 | |
|
96 | --- /dev/null | |
|
97 | +++ b/a | |
|
98 | @@ -0,0 +1,1 @@ | |
|
99 | +a | |
|
100 | ||
|
101 | git=keep: git patch after qrefresh without --git: | |
|
102 | ||
|
103 | $ echo a >> a | |
|
104 | $ hg qrefresh -d '0 0' | |
|
31 | 105 | |
|
32 | hg init repo-keep | |
|
33 | cd repo-keep | |
|
34 | echo '[mq]' > .hg/hgrc | |
|
35 | echo 'git = KEEP' >> .hg/hgrc | |
|
36 | echo '% git=keep: git patch with --git' | |
|
37 | echo a > a | |
|
38 | hg add a | |
|
39 | hg qnew -d '0 0' -f --git git | |
|
40 | cat .hg/patches/git | |
|
41 | echo '% git=keep: git patch after qrefresh without --git' | |
|
42 | echo a >> a | |
|
43 | hg qrefresh -d '0 0' | |
|
44 | cat .hg/patches/git | |
|
45 | cd .. | |
|
106 | $ cat .hg/patches/git | |
|
107 | # HG changeset patch | |
|
108 | # Parent 0000000000000000000000000000000000000000 | |
|
109 | # Date 0 0 | |
|
110 | ||
|
111 | diff --git a/a b/a | |
|
112 | new file mode 100644 | |
|
113 | --- /dev/null | |
|
114 | +++ b/a | |
|
115 | @@ -0,0 +1,2 @@ | |
|
116 | +a | |
|
117 | +a | |
|
118 | $ cd .. | |
|
119 | ||
|
120 | $ hg init repo-yes | |
|
121 | $ cd repo-yes | |
|
122 | $ echo '[mq]' > .hg/hgrc | |
|
123 | $ echo 'git = yes' >> .hg/hgrc | |
|
124 | ||
|
125 | git=yes: git patch: | |
|
126 | ||
|
127 | $ echo a > a | |
|
128 | $ hg add a | |
|
129 | $ hg qnew -d '0 0' -f git | |
|
130 | ||
|
131 | $ cat .hg/patches/git | |
|
132 | # HG changeset patch | |
|
133 | # Parent 0000000000000000000000000000000000000000 | |
|
134 | # Date 0 0 | |
|
135 | ||
|
136 | diff --git a/a b/a | |
|
137 | new file mode 100644 | |
|
138 | --- /dev/null | |
|
139 | +++ b/a | |
|
140 | @@ -0,0 +1,1 @@ | |
|
141 | +a | |
|
142 | ||
|
143 | git=yes: git patch after qrefresh: | |
|
144 | ||
|
145 | $ echo a >> a | |
|
146 | $ hg qrefresh -d '0 0' | |
|
46 | 147 | |
|
47 | hg init repo-yes | |
|
48 | cd repo-yes | |
|
49 | echo '[mq]' > .hg/hgrc | |
|
50 | echo 'git = yes' >> .hg/hgrc | |
|
51 | echo '% git=yes: git patch' | |
|
52 | echo a > a | |
|
53 | hg add a | |
|
54 | hg qnew -d '0 0' -f git | |
|
55 | cat .hg/patches/git | |
|
56 | echo '% git=yes: git patch after qrefresh' | |
|
57 | echo a >> a | |
|
58 | hg qrefresh -d '0 0' | |
|
59 | cat .hg/patches/git | |
|
60 | cd .. | |
|
148 | $ cat .hg/patches/git | |
|
149 | # HG changeset patch | |
|
150 | # Parent 0000000000000000000000000000000000000000 | |
|
151 | # Date 0 0 | |
|
152 | ||
|
153 | diff --git a/a b/a | |
|
154 | new file mode 100644 | |
|
155 | --- /dev/null | |
|
156 | +++ b/a | |
|
157 | @@ -0,0 +1,2 @@ | |
|
158 | +a | |
|
159 | +a | |
|
160 | $ cd .. | |
|
161 | ||
|
162 | $ hg init repo-no | |
|
163 | $ cd repo-no | |
|
164 | $ echo '[diff]' > .hg/hgrc | |
|
165 | $ echo 'git = True' >> .hg/hgrc | |
|
166 | $ echo '[mq]' > .hg/hgrc | |
|
167 | $ echo 'git = False' >> .hg/hgrc | |
|
168 | ||
|
169 | git=no: regular patch with copy: | |
|
170 | ||
|
171 | $ echo a > a | |
|
172 | $ hg add a | |
|
173 | $ hg qnew -d '0 0' -f adda | |
|
174 | $ hg cp a b | |
|
175 | $ hg qnew -d '0 0' -f regular | |
|
61 | 176 | |
|
62 | hg init repo-no | |
|
63 | cd repo-no | |
|
64 | echo '[diff]' > .hg/hgrc | |
|
65 | echo 'git = True' >> .hg/hgrc | |
|
66 | echo '[mq]' > .hg/hgrc | |
|
67 | echo 'git = False' >> .hg/hgrc | |
|
68 | echo '% git=no: regular patch with copy' | |
|
69 | echo a > a | |
|
70 | hg add a | |
|
71 | hg qnew -d '0 0' -f adda | |
|
72 | hg cp a b | |
|
73 | hg qnew -d '0 0' -f regular | |
|
74 | cat .hg/patches/regular | |
|
75 | echo '% git=no: regular patch after qrefresh with copy' | |
|
76 | hg cp a c | |
|
77 | hg qrefresh -d '0 0' | |
|
78 | cat .hg/patches/regular | |
|
79 | cd .. | |
|
177 | $ cat .hg/patches/regular | |
|
178 | # HG changeset patch | |
|
179 | # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4 | |
|
180 | # Date 0 0 | |
|
181 | ||
|
182 | diff -r ef8dafc9fa4c -r a70404f79ba3 b | |
|
183 | --- /dev/null | |
|
184 | +++ b/b | |
|
185 | @@ -0,0 +1,1 @@ | |
|
186 | +a | |
|
187 | ||
|
188 | git=no: regular patch after qrefresh with copy: | |
|
189 | ||
|
190 | $ hg cp a c | |
|
191 | $ hg qrefresh -d '0 0' | |
|
192 | ||
|
193 | $ cat .hg/patches/regular | |
|
194 | # HG changeset patch | |
|
195 | # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4 | |
|
196 | # Date 0 0 | |
|
197 | ||
|
198 | diff -r ef8dafc9fa4c b | |
|
199 | --- /dev/null | |
|
200 | +++ b/b | |
|
201 | @@ -0,0 +1,1 @@ | |
|
202 | +a | |
|
203 | diff -r ef8dafc9fa4c c | |
|
204 | --- /dev/null | |
|
205 | +++ b/c | |
|
206 | @@ -0,0 +1,1 @@ | |
|
207 | +a | |
|
208 | ||
|
209 | $ cd .. | |
|
210 |
@@ -1,79 +1,153 b'' | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | 1 | # Test issue 529 - mq aborts when merging patch deleting files |
|
4 | 2 | |
|
5 | checkundo() | |
|
6 | { | |
|
7 | if [ -f .hg/store/undo ]; then | |
|
8 |
|
|
|
9 | fi | |
|
10 | } | |
|
3 | $ checkundo() | |
|
4 | > { | |
|
5 | > if [ -f .hg/store/undo ]; then | |
|
6 | > echo ".hg/store/undo still exists" | |
|
7 | > fi | |
|
8 | > } | |
|
11 | 9 | |
|
12 | echo "[extensions]" >> $HGRCPATH | |
|
13 | echo "mq =" >> $HGRCPATH | |
|
14 | echo "[mq]" >> $HGRCPATH | |
|
15 | echo "git = keep" >> $HGRCPATH | |
|
10 | $ echo "[extensions]" >> $HGRCPATH | |
|
11 | $ echo "mq =" >> $HGRCPATH | |
|
12 | $ echo "[mq]" >> $HGRCPATH | |
|
13 | $ echo "git = keep" >> $HGRCPATH | |
|
14 | ||
|
15 | Commit two dummy files in "init" changeset: | |
|
16 | 16 | |
|
17 | # Commit two dummy files in "init" changeset | |
|
18 | hg init t | |
|
19 | cd t | |
|
20 |
|
|
|
21 | echo b > b | |
|
22 | hg ci -Am init | |
|
23 | hg tag -l init | |
|
17 | $ hg init t | |
|
18 | $ cd t | |
|
19 | $ echo a > a | |
|
20 | $ echo b > b | |
|
21 | $ hg ci -Am init | |
|
22 | adding a | |
|
23 | adding b | |
|
24 | $ hg tag -l init | |
|
25 | ||
|
26 | Create a patch removing a: | |
|
27 | ||
|
28 | $ hg qnew rm_a | |
|
29 | $ hg rm a | |
|
30 | $ hg qrefresh -m "rm a" | |
|
24 | 31 | |
|
25 | # Create a patch removing a | |
|
26 | hg qnew rm_a | |
|
27 | hg rm a | |
|
28 | hg qrefresh -m "rm a" | |
|
32 | Save the patch queue so we can merge it later: | |
|
33 | ||
|
34 | $ hg qsave -c -e | |
|
35 | copy .*/t/.hg/patches to .*/t/.hg/patches.1 | |
|
36 | $ checkundo | |
|
37 | ||
|
38 | Update b and commit in an "update" changeset: | |
|
29 | 39 | |
|
30 | # Save the patch queue so we can merge it later | |
|
31 | hg qsave -c -e 2>&1 | grep -v '^copy' | |
|
32 | checkundo qsave | |
|
33 | ||
|
34 | # Update b and commit in an "update" changeset | |
|
35 | hg up -C init | |
|
36 | echo b >> b | |
|
37 | hg st | |
|
38 | hg ci -m update | |
|
40 | $ hg up -C init | |
|
41 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
42 | $ echo b >> b | |
|
43 | $ hg st | |
|
44 | M b | |
|
45 | $ hg ci -m update | |
|
46 | created new head | |
|
39 | 47 | |
|
40 | 48 | # Here, qpush used to abort with : |
|
41 | 49 | # The system cannot find the file specified => a |
|
42 | hg manifest | |
|
43 | hg qpush -a -m 2>&1 | grep -v '^merging' | |
|
44 | checkundo 'qpush -m' | |
|
45 | hg manifest | |
|
50 | $ hg manifest | |
|
51 | a | |
|
52 | b | |
|
53 | ||
|
54 | $ hg qpush -a -m | |
|
55 | merging with queue at: .*/t/.hg/patches.1 | |
|
56 | applying rm_a | |
|
57 | now at: rm_a | |
|
58 | ||
|
59 | $ checkundo | |
|
60 | $ hg manifest | |
|
61 | b | |
|
62 | ||
|
63 | Ensure status is correct after merge: | |
|
64 | ||
|
65 | $ hg qpop -a | |
|
66 | popping rm_a | |
|
67 | popping .hg.patches.merge.marker | |
|
68 | patch queue now empty | |
|
69 | ||
|
70 | $ cd .. | |
|
71 | ||
|
72 | Classic MQ merge sequence *with an explicit named queue*: | |
|
46 | 73 | |
|
47 | # ensure status is correct after merge | |
|
48 | hg qpop -a | |
|
49 | cd .. | |
|
74 | $ hg init t2 | |
|
75 | $ cd t2 | |
|
76 | $ echo '[diff]' > .hg/hgrc | |
|
77 | $ echo 'nodates = 1' >> .hg/hgrc | |
|
78 | $ echo a > a | |
|
79 | $ hg ci -Am init | |
|
80 | adding a | |
|
81 | $ echo b > a | |
|
82 | $ hg ci -m changea | |
|
83 | $ hg up -C 0 | |
|
84 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
85 | $ hg cp a aa | |
|
86 | $ echo c >> a | |
|
87 | $ hg qnew --git -f -e patcha | |
|
88 | $ echo d >> a | |
|
89 | $ hg qnew -d '0 0' -f -e patcha2 | |
|
90 | ||
|
91 | Create the reference queue: | |
|
92 | ||
|
93 | $ hg qsave -c -e -n refqueue | |
|
94 | copy .*/t2/.hg/patches to .*/t2/.hg/refqueue | |
|
95 | $ hg up -C 1 | |
|
96 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
97 | ||
|
98 | Merge: | |
|
50 | 99 | |
|
51 | # Classic MQ merge sequence *with an explicit named queue* | |
|
52 | echo | |
|
53 | echo % init t2 | |
|
54 | hg init t2 | |
|
55 | cd t2 | |
|
56 | echo '[diff]' > .hg/hgrc | |
|
57 | echo 'nodates = 1' >> .hg/hgrc | |
|
58 | echo a > a | |
|
59 | hg ci -Am init | |
|
60 | echo b > a | |
|
61 | hg ci -m changea | |
|
62 | hg up -C 0 | |
|
63 | hg cp a aa | |
|
64 | echo c >> a | |
|
65 | hg qnew --git -f -e patcha | |
|
66 | echo d >> a | |
|
67 | hg qnew -d '0 0' -f -e patcha2 | |
|
68 | echo % create the reference queue | |
|
69 | hg qsave -c -e -n refqueue 2> /dev/null | |
|
70 | hg up -C 1 | |
|
71 | echo % merge | |
|
72 | HGMERGE=internal:other hg qpush -a -m -n refqueue 2>&1 | \ | |
|
73 | sed 's/merging with queue at.*refqueue/merging with queue at refqueue/' | |
|
74 | echo % check patcha is still a git patch | |
|
75 | cat .hg/patches/patcha | |
|
76 | echo % check patcha2 is still a regular patch | |
|
77 | grep git .hg/patches/patcha2 && echo 'git patch found!' | |
|
78 | cd .. | |
|
100 | $ HGMERGE=internal:other hg qpush -a -m -n refqueue | |
|
101 | merging with queue at: .*/t2/.hg/refqueue | |
|
102 | applying patcha | |
|
103 | patching file a | |
|
104 | Hunk #1 FAILED at 0 | |
|
105 | 1 out of 1 hunks FAILED -- saving rejects to file a.rej | |
|
106 | patch failed, unable to continue (try -v) | |
|
107 | patch failed, rejects left in working dir | |
|
108 | patch didn't work out, merging patcha | |
|
109 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
110 | 0 files updated, 2 files merged, 0 files removed, 0 files unresolved | |
|
111 | (branch merge, don't forget to commit) | |
|
112 | applying patcha2 | |
|
113 | now at: patcha2 | |
|
114 | ||
|
115 | Check patcha is still a git patch: | |
|
79 | 116 | |
|
117 | $ cat .hg/patches/patcha | |
|
118 | # HG changeset patch | |
|
119 | # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4 | |
|
120 | ||
|
121 | diff --git a/a b/a | |
|
122 | --- a/a | |
|
123 | +++ b/a | |
|
124 | @@ -1,1 +1,2 @@ | |
|
125 | -b | |
|
126 | +a | |
|
127 | +c | |
|
128 | diff --git a/a b/aa | |
|
129 | copy from a | |
|
130 | copy to aa | |
|
131 | --- a/a | |
|
132 | +++ b/aa | |
|
133 | @@ -1,1 +1,1 @@ | |
|
134 | -b | |
|
135 | +a | |
|
136 | ||
|
137 | Check patcha2 is still a regular patch: | |
|
138 | ||
|
139 | $ cat .hg/patches/patcha2 | |
|
140 | # HG changeset patch | |
|
141 | # Parent ........................................ | |
|
142 | # Date 0 0 | |
|
143 | ||
|
144 | diff -r ............ -r ............ a | |
|
145 | --- a/a | |
|
146 | +++ b/a | |
|
147 | @@ -1,2 +1,3 @@ | |
|
148 | a | |
|
149 | c | |
|
150 | +d | |
|
151 | ||
|
152 | $ cd .. | |
|
153 |
@@ -1,85 +1,150 b'' | |||
|
1 | #!/bin/sh | |
|
2 | 1 | |
|
3 | 2 | # Test issue835: |
|
4 | 3 | # qpush fails immediately when patching a missing file, but |
|
5 | 4 | # remaining added files are still created empty which will |
|
6 | 5 | # trick a future qrefresh. |
|
7 | 6 | |
|
8 | cat > writelines.py <<EOF | |
|
9 | import sys | |
|
10 | path = sys.argv[1] | |
|
11 | args = sys.argv[2:] | |
|
12 | assert (len(args) % 2) == 0 | |
|
7 | $ cat > writelines.py <<EOF | |
|
8 | > import sys | |
|
9 | > path = sys.argv[1] | |
|
10 | > args = sys.argv[2:] | |
|
11 | > assert (len(args) % 2) == 0 | |
|
12 | > | |
|
13 | > f = file(path, 'wb') | |
|
14 | > for i in xrange(len(args)/2): | |
|
15 | > count, s = args[2*i:2*i+2] | |
|
16 | > count = int(count) | |
|
17 | > s = s.decode('string_escape') | |
|
18 | > f.write(s*count) | |
|
19 | > f.close() | |
|
20 | > EOF | |
|
21 | ||
|
22 | $ echo "[extensions]" >> $HGRCPATH | |
|
23 | $ echo "mq=" >> $HGRCPATH | |
|
13 | 24 | |
|
14 | f = file(path, 'wb') | |
|
15 | for i in xrange(len(args)/2): | |
|
16 | count, s = args[2*i:2*i+2] | |
|
17 | count = int(count) | |
|
18 | s = s.decode('string_escape') | |
|
19 | f.write(s*count) | |
|
20 | f.close() | |
|
25 | $ hg init normal | |
|
26 | $ cd normal | |
|
27 | $ python ../writelines.py b 10 'a\n' | |
|
28 | $ hg ci -Am addb | |
|
29 | adding b | |
|
30 | $ echo a > a | |
|
31 | $ python ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n' | |
|
32 | $ echo c > c | |
|
33 | $ hg add a c | |
|
34 | $ hg qnew -f changeb | |
|
35 | $ hg qpop | |
|
36 | popping changeb | |
|
37 | patch queue now empty | |
|
38 | $ hg rm b | |
|
39 | $ hg ci -Am rmb | |
|
21 | 40 | |
|
22 | EOF | |
|
23 | ||
|
24 | echo "[extensions]" >> $HGRCPATH | |
|
25 | echo "mq=" >> $HGRCPATH | |
|
41 | Push patch with missing target: | |
|
26 | 42 | |
|
27 | hg init normal | |
|
28 | cd normal | |
|
29 | python ../writelines.py b 10 'a\n' | |
|
30 | hg ci -Am addb | |
|
31 | echo a > a | |
|
32 | python ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n' | |
|
33 | echo c > c | |
|
34 | hg add a c | |
|
35 | hg qnew -f changeb | |
|
36 | hg qpop | |
|
37 | hg rm b | |
|
38 | hg ci -Am rmb | |
|
39 | echo % push patch with missing target | |
|
40 | hg qpush | |
|
41 | echo % display added files | |
|
42 | cat a | |
|
43 | cat c | |
|
44 | echo % display rejections | |
|
45 | cat b.rej | |
|
46 | cd .. | |
|
43 | $ hg qpush | |
|
44 | applying changeb | |
|
45 | unable to find 'b' for patching | |
|
46 | 2 out of 2 hunks FAILED -- saving rejects to file b.rej | |
|
47 | patch failed, unable to continue (try -v) | |
|
48 | patch failed, rejects left in working dir | |
|
49 | errors during apply, please fix and refresh changeb | |
|
50 | [2] | |
|
51 | ||
|
52 | Display added files: | |
|
53 | ||
|
54 | $ cat a | |
|
55 | a | |
|
56 | $ cat c | |
|
57 | c | |
|
58 | ||
|
59 | Display rejections: | |
|
60 | ||
|
61 | $ cat b.rej | |
|
62 | --- b | |
|
63 | +++ b | |
|
64 | @@ -1,3 +1,5 @@ | |
|
65 | +b | |
|
66 | +b | |
|
67 | a | |
|
68 | a | |
|
69 | a | |
|
70 | @@ -8,3 +10,5 @@ | |
|
71 | a | |
|
72 | a | |
|
73 | a | |
|
74 | +c | |
|
75 | +c | |
|
76 | ||
|
77 | $ cd .. | |
|
47 | 78 | |
|
48 | 79 | |
|
49 | echo "[diff]" >> $HGRCPATH | |
|
50 | echo "git=1" >> $HGRCPATH | |
|
80 | $ echo "[diff]" >> $HGRCPATH | |
|
81 | $ echo "git=1" >> $HGRCPATH | |
|
82 | ||
|
83 | $ hg init git | |
|
84 | $ cd git | |
|
85 | $ python ../writelines.py b 1 '\x00' | |
|
86 | $ hg ci -Am addb | |
|
87 | adding b | |
|
88 | $ echo a > a | |
|
89 | $ python ../writelines.py b 1 '\x01' 1 '\x00' | |
|
90 | $ echo c > c | |
|
91 | $ hg add a c | |
|
92 | $ hg qnew -f changeb | |
|
93 | $ hg qpop | |
|
94 | popping changeb | |
|
95 | patch queue now empty | |
|
96 | $ hg rm b | |
|
97 | $ hg ci -Am rmb | |
|
98 | ||
|
99 | Push git patch with missing target: | |
|
100 | ||
|
101 | $ hg qpush | |
|
102 | applying changeb | |
|
103 | unable to find 'b' for patching | |
|
104 | 1 out of 1 hunks FAILED -- saving rejects to file b.rej | |
|
105 | patch failed, unable to continue (try -v) | |
|
106 | b: No such file or directory | |
|
107 | patch failed, rejects left in working dir | |
|
108 | errors during apply, please fix and refresh changeb | |
|
109 | [2] | |
|
110 | $ hg st | |
|
111 | ? b.rej | |
|
112 | ||
|
113 | Display added files: | |
|
51 | 114 | |
|
52 | hg init git | |
|
53 | cd git | |
|
54 | python ../writelines.py b 1 '\x00' | |
|
55 | hg ci -Am addb | |
|
56 | echo a > a | |
|
57 | python ../writelines.py b 1 '\x01' 1 '\x00' | |
|
58 | echo c > c | |
|
59 | hg add a c | |
|
60 | hg qnew -f changeb | |
|
61 | hg qpop | |
|
62 | hg rm b | |
|
63 | hg ci -Am rmb | |
|
64 | echo % push git patch with missing target | |
|
65 | hg qpush 2>&1 | sed -e 's/b:.*/b: No such file or directory/' | |
|
66 | hg st | |
|
67 | echo % display added files | |
|
68 | cat a | |
|
69 | cat c | |
|
70 | echo % display rejections | |
|
71 | cat b.rej | |
|
72 | cd .. | |
|
115 | $ cat a | |
|
116 | a | |
|
117 | $ cat c | |
|
118 | c | |
|
119 | ||
|
120 | Display rejections: | |
|
121 | ||
|
122 | $ cat b.rej | |
|
123 | --- b | |
|
124 | +++ b | |
|
125 | GIT binary patch | |
|
126 | literal 2 | |
|
127 | Jc${No0000400IC2 | |
|
128 | ||
|
129 | $ cd .. | |
|
130 | ||
|
131 | Test push creating directory during git copy or rename: | |
|
73 | 132 | |
|
74 | echo % test push creating directory during git copy or rename | |
|
75 |
|
|
|
76 | cd missingdir | |
|
77 | echo a > a | |
|
78 | hg ci -Am adda | |
|
79 | mkdir d | |
|
80 | hg copy a d/a2 | |
|
81 | hg mv a d/a | |
|
82 | hg qnew -g -f patch | |
|
83 | hg qpop | |
|
84 | hg qpush | |
|
85 | cd .. | |
|
133 | $ hg init missingdir | |
|
134 | $ cd missingdir | |
|
135 | $ echo a > a | |
|
136 | $ hg ci -Am adda | |
|
137 | adding a | |
|
138 | $ mkdir d | |
|
139 | $ hg copy a d/a2 | |
|
140 | $ hg mv a d/a | |
|
141 | $ hg qnew -g -f patch | |
|
142 | $ hg qpop | |
|
143 | popping patch | |
|
144 | patch queue now empty | |
|
145 | $ hg qpush | |
|
146 | applying patch | |
|
147 | now at: patch | |
|
148 | ||
|
149 | $ cd .. | |
|
150 |
@@ -1,83 +1,131 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ cat <<EOF >> $HGRCPATH | |
|
2 | > [extensions] | |
|
3 | > mq= | |
|
4 | > [alias] | |
|
5 | > tlog = log --template "{rev}: {desc}\\n" | |
|
6 | > theads = heads --template "{rev}: {desc}\\n" | |
|
7 | > tincoming = incoming --template "{rev}: {desc}\\n" | |
|
8 | > EOF | |
|
9 | ||
|
10 | Setup main: | |
|
2 | 11 | |
|
3 | cat <<EOF >> $HGRCPATH | |
|
4 | [extensions] | |
|
5 | mq= | |
|
6 | [defaults] | |
|
7 | log = --template "{rev}: {desc}\\n" | |
|
8 | heads = --template "{rev}: {desc}\\n" | |
|
9 | incoming = --template "{rev}: {desc}\\n" | |
|
10 | EOF | |
|
12 | $ hg init base | |
|
13 | $ cd base | |
|
14 | $ echo "One" > one | |
|
15 | $ hg add | |
|
16 | adding one | |
|
17 | $ hg ci -m "main: one added" | |
|
18 | $ echo "++" >> one | |
|
19 | $ hg ci -m "main: one updated" | |
|
20 | ||
|
21 | Bundle main: | |
|
22 | ||
|
23 | $ hg bundle --base=null ../main.hg | |
|
24 | 2 changesets found | |
|
25 | ||
|
26 | $ cd .. | |
|
27 | ||
|
28 | Incoming to fresh repo: | |
|
29 | ||
|
30 | $ hg init fresh | |
|
11 | 31 | |
|
12 | echo "====== Setup main" | |
|
13 | hg init base | |
|
14 | cd base | |
|
15 | echo "One" > one | |
|
16 | hg add | |
|
17 | hg ci -m "main: one added." | |
|
18 | echo "++" >> one | |
|
19 |
|
|
|
32 | $ hg -R fresh tincoming main.hg | |
|
33 | comparing with main.hg | |
|
34 | 0: main: one added | |
|
35 | 1: main: one updated | |
|
36 | ||
|
37 | $ hg -R fresh tincoming bundle:fresh+main.hg | |
|
38 | comparing with bundle:fresh+main.hg | |
|
39 | 0: main: one added | |
|
40 | 1: main: one updated | |
|
41 | ||
|
42 | ||
|
43 | Setup queue: | |
|
20 | 44 | |
|
21 | echo "====== Bundle main" | |
|
22 | hg bundle --base=null ../main.hg | |
|
23 | cd .. | |
|
45 | $ cd base | |
|
46 | $ hg qinit -c | |
|
47 | $ hg qnew -m "patch: two added" two.patch | |
|
48 | $ echo two > two | |
|
49 | $ hg add | |
|
50 | adding two | |
|
51 | $ hg qrefresh | |
|
52 | $ hg qcommit -m "queue: two.patch added" | |
|
53 | $ hg qpop -a | |
|
54 | popping two.patch | |
|
55 | patch queue now empty | |
|
24 | 56 | |
|
25 | echo "====== Incoming to fresh repo" | |
|
26 | hg init fresh | |
|
27 | echo ">> hg -R fresh incoming main.hg" | |
|
28 | hg -R fresh incoming main.hg | |
|
29 | echo ">> hg -R fresh incoming bundle:fresh+main.hg" | |
|
30 | hg -R fresh incoming bundle:fresh+main.hg | |
|
57 | Bundle queue: | |
|
58 | ||
|
59 | $ hg -R .hg/patches bundle --base=null ../queue.hgq | |
|
60 | 1 changesets found | |
|
61 | ||
|
62 | $ cd .. | |
|
31 | 63 | |
|
32 | 64 | |
|
33 | echo "====== Setup queue" | |
|
34 | cd base | |
|
35 | hg qinit -c | |
|
36 | hg qnew -m "patch: two added." two.patch | |
|
37 | echo two > two | |
|
38 | hg add | |
|
39 | hg qrefresh | |
|
40 | hg qcommit -m "queue: two.patch added." | |
|
41 | hg qpop -a | |
|
65 | Clone base: | |
|
66 | ||
|
67 | $ hg clone base copy | |
|
68 | updating to branch default | |
|
69 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
70 | $ cd copy | |
|
71 | $ hg qinit -c | |
|
72 | ||
|
73 | Incoming queue bundle: | |
|
74 | ||
|
75 | $ hg -R .hg/patches tincoming ../queue.hgq | |
|
76 | comparing with ../queue.hgq | |
|
77 | 0: queue: two.patch added | |
|
78 | ||
|
79 | Pull queue bundle: | |
|
42 | 80 | |
|
43 | echo "====== Bundle queue" | |
|
44 | hg -R .hg/patches bundle --base=null ../queue.hgq | |
|
45 | cd .. | |
|
81 | $ hg -R .hg/patches pull --update ../queue.hgq | |
|
82 | pulling from ../queue.hgq | |
|
83 | requesting all changes | |
|
84 | adding changesets | |
|
85 | adding manifests | |
|
86 | adding file changes | |
|
87 | added 1 changesets with 3 changes to 3 files | |
|
88 | merging series | |
|
89 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
90 | ||
|
91 | $ hg -R .hg/patches theads | |
|
92 | 0: queue: two.patch added | |
|
93 | ||
|
94 | $ hg -R .hg/patches tlog | |
|
95 | 0: queue: two.patch added | |
|
96 | ||
|
97 | $ hg qseries | |
|
98 | two.patch | |
|
99 | ||
|
100 | $ cd .. | |
|
46 | 101 | |
|
47 | 102 | |
|
48 | echo "====== Clone base" | |
|
49 | hg clone base copy | |
|
50 | cd copy | |
|
51 | hg qinit -c | |
|
103 | Clone base again: | |
|
52 | 104 | |
|
53 | echo "====== Incoming queue bundle" | |
|
54 | echo ">> hg -R .hg/patches incoming ../queue.hgq" | |
|
55 | hg -R .hg/patches incoming ../queue.hgq | |
|
105 | $ hg clone base copy2 | |
|
106 | updating to branch default | |
|
107 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
108 | $ cd copy2 | |
|
109 | $ hg qinit -c | |
|
110 | ||
|
111 | Unbundle queue bundle: | |
|
56 | 112 | |
|
57 | echo "====== Pull queue bundle" | |
|
58 | echo ">> hg -R .hg/patches pull --update ../queue.hgq" | |
|
59 | hg -R .hg/patches pull --update ../queue.hgq | |
|
60 | echo ">> hg -R .hg/patches heads" | |
|
61 | hg -R .hg/patches heads | |
|
62 | echo ">> hg -R .hg/patches log" | |
|
63 | hg -R .hg/patches log | |
|
64 | echo ">> hg qseries" | |
|
65 | hg qseries | |
|
66 | cd .. | |
|
67 | ||
|
113 | $ hg -R .hg/patches unbundle --update ../queue.hgq | |
|
114 | adding changesets | |
|
115 | adding manifests | |
|
116 | adding file changes | |
|
117 | added 1 changesets with 3 changes to 3 files | |
|
118 | merging series | |
|
119 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
68 | 120 | |
|
69 | echo "====== Clone base again" | |
|
70 | hg clone base copy2 | |
|
71 | cd copy2 | |
|
72 | hg qinit -c | |
|
121 | $ hg -R .hg/patches theads | |
|
122 | 0: queue: two.patch added | |
|
123 | ||
|
124 | $ hg -R .hg/patches tlog | |
|
125 | 0: queue: two.patch added | |
|
73 | 126 | |
|
74 | echo "====== Unbundle queue bundle" | |
|
75 | echo ">> hg -R .hg/patches unbundle --update ../queue.hgq" | |
|
76 | hg -R .hg/patches unbundle --update ../queue.hgq | |
|
77 | echo ">> hg -R .hg/patches heads" | |
|
78 | hg -R .hg/patches heads | |
|
79 | echo ">> hg -R .hg/patches log" | |
|
80 | hg -R .hg/patches log | |
|
81 | echo ">> hg qseries" | |
|
82 | hg qseries | |
|
83 | cd .. | |
|
127 | $ hg qseries | |
|
128 | two.patch | |
|
129 | ||
|
130 | $ cd .. | |
|
131 |
@@ -1,67 +1,150 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "mq=" >> $HGRCPATH | |
|
3 | ||
|
4 | $ hg init a | |
|
5 | $ cd a | |
|
2 | 6 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
7 | $ echo 'base' > base | |
|
8 | $ hg ci -Ambase -d '1 0' | |
|
9 | adding base | |
|
10 | ||
|
11 | $ hg qnew -d '1 0' a | |
|
12 | $ hg qnew -d '1 0' b | |
|
13 | $ hg qnew -d '1 0' c | |
|
5 | 14 | |
|
6 | hg init a | |
|
7 | cd a | |
|
15 | $ hg qdel | |
|
16 | abort: qdelete requires at least one revision or patch name | |
|
17 | [255] | |
|
18 | ||
|
19 | $ hg qdel c | |
|
20 | abort: cannot delete applied patch c | |
|
21 | [255] | |
|
8 | 22 | |
|
9 | echo 'base' > base | |
|
10 | hg ci -Ambase -d '1 0' | |
|
23 | $ hg qpop | |
|
24 | popping c | |
|
25 | now at: b | |
|
11 | 26 | |
|
12 | hg qnew -d '1 0' a | |
|
13 | hg qnew -d '1 0' b | |
|
14 | hg qnew -d '1 0' c | |
|
27 | $ hg qdel c | |
|
28 | ||
|
29 | $ hg qseries | |
|
30 | a | |
|
31 | b | |
|
15 | 32 | |
|
16 | hg qdel | |
|
33 | $ ls .hg/patches | |
|
34 | a | |
|
35 | b | |
|
36 | series | |
|
37 | status | |
|
38 | ||
|
39 | $ hg qpop | |
|
40 | popping b | |
|
41 | now at: a | |
|
42 | ||
|
43 | $ hg qdel -k 1 | |
|
44 | ||
|
45 | $ ls .hg/patches | |
|
46 | a | |
|
47 | b | |
|
48 | series | |
|
49 | status | |
|
50 | ||
|
51 | $ hg qdel -r a | |
|
52 | patch a finalized without changeset message | |
|
17 | 53 | |
|
18 | hg qdel c | |
|
19 | hg qpop | |
|
20 | hg qdel c | |
|
21 | hg qseries | |
|
22 | ls .hg/patches | |
|
23 | hg qpop | |
|
24 | hg qdel -k 1 | |
|
25 | ls .hg/patches | |
|
26 | hg qdel -r a | |
|
27 | hg qapplied | |
|
28 | hg log --template '{rev} {desc}\n' | |
|
54 | $ hg qapplied | |
|
55 | ||
|
56 | $ hg log --template '{rev} {desc}\n' | |
|
57 | 1 [mq]: a | |
|
58 | 0 base | |
|
59 | ||
|
60 | $ hg qnew d | |
|
61 | $ hg qnew e | |
|
62 | $ hg qnew f | |
|
29 | 63 | |
|
30 | hg qnew d | |
|
31 | hg qnew e | |
|
32 | hg qnew f | |
|
64 | $ hg qdel -r e | |
|
65 | abort: cannot delete revision 3 above applied patches | |
|
66 | [255] | |
|
67 | ||
|
68 | $ hg qdel -r qbase:e | |
|
69 | patch d finalized without changeset message | |
|
70 | patch e finalized without changeset message | |
|
71 | ||
|
72 | $ hg qapplied | |
|
73 | f | |
|
33 | 74 | |
|
34 | hg qdel -r e | |
|
35 | hg qdel -r qbase:e | |
|
36 | hg qapplied | |
|
37 | hg log --template '{rev} {desc}\n' | |
|
75 | $ hg log --template '{rev} {desc}\n' | |
|
76 | 4 [mq]: f | |
|
77 | 3 [mq]: e | |
|
78 | 2 [mq]: d | |
|
79 | 1 [mq]: a | |
|
80 | 0 base | |
|
81 | ||
|
82 | $ cd .. | |
|
83 | ||
|
84 | $ hg init b | |
|
85 | $ cd b | |
|
86 | ||
|
87 | $ echo 'base' > base | |
|
88 | $ hg ci -Ambase -d '1 0' | |
|
89 | adding base | |
|
38 | 90 | |
|
39 | cd .. | |
|
40 | hg init b | |
|
41 | cd b | |
|
91 | $ hg qfinish | |
|
92 | abort: no revisions specified | |
|
93 | [255] | |
|
94 | ||
|
95 | $ hg qfinish -a | |
|
96 | no patches applied | |
|
42 | 97 | |
|
43 | echo 'base' > base | |
|
44 | hg ci -Ambase -d '1 0' | |
|
98 | $ hg qnew -d '1 0' a | |
|
99 | $ hg qnew -d '1 0' b | |
|
100 | $ hg qnew c # XXX fails to apply by /usr/bin/patch if we put a date | |
|
45 | 101 | |
|
46 | hg qfinish | |
|
47 | hg qfinish -a | |
|
102 | $ hg qfinish 0 | |
|
103 | abort: revision 0 is not managed | |
|
104 | [255] | |
|
105 | ||
|
106 | $ hg qfinish b | |
|
107 | abort: cannot delete revision 2 above applied patches | |
|
108 | [255] | |
|
48 | 109 | |
|
49 | hg qnew -d '1 0' a | |
|
50 | hg qnew -d '1 0' b | |
|
51 | hg qnew c # XXX fails to apply by /usr/bin/patch if we put a date | |
|
110 | $ hg qpop | |
|
111 | popping c | |
|
112 | now at: b | |
|
113 | ||
|
114 | $ hg qfinish -a c | |
|
115 | abort: unknown revision 'c'! | |
|
116 | [255] | |
|
52 | 117 | |
|
53 | hg qfinish 0 | |
|
54 | hg qfinish b | |
|
118 | $ hg qpush | |
|
119 | applying c | |
|
120 | patch c is empty | |
|
121 | now at: c | |
|
122 | ||
|
123 | $ hg qfinish qbase:b | |
|
124 | patch a finalized without changeset message | |
|
125 | patch b finalized without changeset message | |
|
126 | ||
|
127 | $ hg qapplied | |
|
128 | c | |
|
55 | 129 | |
|
56 | hg qpop | |
|
57 | hg qfinish -a c | |
|
58 | hg qpush | |
|
130 | $ hg log --template '{rev} {desc}\n' | |
|
131 | 3 imported patch c | |
|
132 | 2 [mq]: b | |
|
133 | 1 [mq]: a | |
|
134 | 0 base | |
|
135 | ||
|
136 | $ hg qfinish -a c | |
|
137 | patch c finalized without changeset message | |
|
138 | ||
|
139 | $ hg qapplied | |
|
59 | 140 | |
|
60 | hg qfinish qbase:b | |
|
61 | hg qapplied | |
|
62 | hg log --template '{rev} {desc}\n' | |
|
141 | $ hg log --template '{rev} {desc}\n' | |
|
142 | 3 imported patch c | |
|
143 | 2 [mq]: b | |
|
144 | 1 [mq]: a | |
|
145 | 0 base | |
|
63 | 146 | |
|
64 | hg qfinish -a c | |
|
65 | hg qapplied | |
|
66 | hg log --template '{rev} {desc}\n' | |
|
67 | ls .hg/patches | |
|
147 | $ ls .hg/patches | |
|
148 | series | |
|
149 | status | |
|
150 |
@@ -1,72 +1,166 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "mq=" >> $HGRCPATH | |
|
3 | $ echo "[mq]" >> $HGRCPATH | |
|
4 | $ echo "git=keep" >> $HGRCPATH | |
|
5 | ||
|
6 | $ hg init a | |
|
7 | $ cd a | |
|
2 | 8 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
5 | echo "[mq]" >> $HGRCPATH | |
|
6 | echo "git=keep" >> $HGRCPATH | |
|
9 | $ echo 'base' > base | |
|
10 | $ hg ci -Ambase | |
|
11 | adding base | |
|
12 | ||
|
13 | $ hg qnew -mmqbase mqbase | |
|
14 | ||
|
15 | $ echo 'patched' > base | |
|
16 | $ hg qrefresh | |
|
17 | ||
|
18 | qdiff: | |
|
7 | 19 | |
|
8 | echo % init | |
|
9 | hg init a | |
|
10 | cd a | |
|
20 | $ hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
21 | diff -r d20a80d4def3 base | |
|
22 | --- a/base Thu Jan 01 00:00:00 1970 +0000 | |
|
23 | +++ b/base | |
|
24 | @@ -1,1 +1,1 @@ | |
|
25 | -base | |
|
26 | +patched | |
|
27 | ||
|
28 | qdiff dirname: | |
|
11 | 29 | |
|
12 | echo % commit | |
|
13 | echo 'base' > base | |
|
14 | hg ci -Ambase -d '1 0' | |
|
30 | $ hg qdiff --nodates . | |
|
31 | diff -r d20a80d4def3 base | |
|
32 | --- a/base | |
|
33 | +++ b/base | |
|
34 | @@ -1,1 +1,1 @@ | |
|
35 | -base | |
|
36 | +patched | |
|
15 | 37 | |
|
16 | echo % qnew mqbase | |
|
17 | hg qnew -mmqbase mqbase | |
|
38 | qdiff filename: | |
|
18 | 39 | |
|
19 | echo % qrefresh | |
|
20 | echo 'patched' > base | |
|
21 | hg qrefresh | |
|
40 | $ hg qdiff --nodates base | |
|
41 | diff -r d20a80d4def3 base | |
|
42 | --- a/base | |
|
43 | +++ b/base | |
|
44 | @@ -1,1 +1,1 @@ | |
|
45 | -base | |
|
46 | +patched | |
|
22 | 47 | |
|
23 | echo % qdiff | |
|
24 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
25 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
48 | $ hg revert -a | |
|
49 | ||
|
50 | $ hg qpop | |
|
51 | popping mqbase | |
|
52 | patch queue now empty | |
|
53 | ||
|
54 | $ hg qdelete mqbase | |
|
26 | 55 | |
|
27 | echo % qdiff dirname | |
|
28 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
29 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
56 | $ printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines | |
|
57 | $ hg ci -Amlines -d '2 0' | |
|
58 | adding lines | |
|
59 | ||
|
60 | $ hg qnew -mmqbase2 mqbase2 | |
|
61 | $ printf '\n\n1\n2\n3\n4\nhello world\n goodbye world\n7\n8\n9\n' > lines | |
|
30 | 62 | |
|
31 | echo % qdiff filename | |
|
32 | hg qdiff --nodates base | |
|
33 | ||
|
34 | echo % revert | |
|
35 | hg revert -a | |
|
63 | $ hg qdiff --nodates -U 1 | |
|
64 | diff -r b0c220e1cf43 lines | |
|
65 | --- a/lines | |
|
66 | +++ b/lines | |
|
67 | @@ -1,1 +1,3 @@ | |
|
68 | + | |
|
69 | + | |
|
70 | 1 | |
|
71 | @@ -4,4 +6,4 @@ | |
|
72 | 4 | |
|
73 | -hello world | |
|
74 | -goodbye world | |
|
75 | +hello world | |
|
76 | + goodbye world | |
|
77 | 7 | |
|
36 | 78 | |
|
37 | echo % qpop | |
|
38 | hg qpop | |
|
39 | ||
|
40 | echo % qdelete mqbase | |
|
41 | hg qdelete mqbase | |
|
79 | $ hg qdiff --nodates -b | |
|
80 | diff -r b0c220e1cf43 lines | |
|
81 | --- a/lines | |
|
82 | +++ b/lines | |
|
83 | @@ -1,9 +1,11 @@ | |
|
84 | + | |
|
85 | + | |
|
86 | 1 | |
|
87 | 2 | |
|
88 | 3 | |
|
89 | 4 | |
|
90 | hello world | |
|
91 | -goodbye world | |
|
92 | + goodbye world | |
|
93 | 7 | |
|
94 | 8 | |
|
95 | 9 | |
|
42 | 96 | |
|
43 | echo % commit 2 | |
|
44 | printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines | |
|
45 | hg ci -Amlines -d '2 0' | |
|
97 | $ hg qdiff --nodates -U 1 -B | |
|
98 | diff -r b0c220e1cf43 lines | |
|
99 | --- a/lines | |
|
100 | +++ b/lines | |
|
101 | @@ -4,4 +6,4 @@ | |
|
102 | 4 | |
|
103 | -hello world | |
|
104 | -goodbye world | |
|
105 | +hello world | |
|
106 | + goodbye world | |
|
107 | 7 | |
|
46 | 108 | |
|
47 | echo % qnew 2 | |
|
48 | hg qnew -mmqbase2 mqbase2 | |
|
49 | printf '\n\n1\n2\n3\n4\nhello world\n goodbye world\n7\n8\n9\n' > lines | |
|
50 | ||
|
51 | echo % qdiff -U 1 | |
|
52 | hg qdiff --nodates -U 1 | |
|
109 | $ hg qdiff --nodates -w | |
|
110 | diff -r b0c220e1cf43 lines | |
|
111 | --- a/lines | |
|
112 | +++ b/lines | |
|
113 | @@ -1,3 +1,5 @@ | |
|
114 | + | |
|
115 | + | |
|
116 | 1 | |
|
117 | 2 | |
|
118 | 3 | |
|
53 | 119 | |
|
54 | echo % qdiff -b | |
|
55 | hg qdiff --nodates -b | |
|
120 | $ hg qdiff --nodates --reverse | |
|
121 | diff -r b0c220e1cf43 lines | |
|
122 | --- a/lines | |
|
123 | +++ b/lines | |
|
124 | @@ -1,11 +1,9 @@ | |
|
125 | - | |
|
126 | - | |
|
127 | 1 | |
|
128 | 2 | |
|
129 | 3 | |
|
130 | 4 | |
|
131 | -hello world | |
|
132 | - goodbye world | |
|
133 | +hello world | |
|
134 | +goodbye world | |
|
135 | 7 | |
|
136 | 8 | |
|
137 | 9 | |
|
56 | 138 | |
|
57 | echo % qdiff -U 1 -B | |
|
58 | hg qdiff --nodates -U 1 -B | |
|
59 | ||
|
60 | echo % qdiff -w | |
|
61 | hg qdiff --nodates -w | |
|
139 | qdiff preserve existing git flag: | |
|
62 | 140 | |
|
63 | echo % qdiff --reverse | |
|
64 | hg qdiff --nodates --reverse | |
|
141 | $ hg qrefresh --git | |
|
142 | $ echo a >> lines | |
|
143 | $ hg qdiff | |
|
144 | diff --git a/lines b/lines | |
|
145 | --- a/lines | |
|
146 | +++ b/lines | |
|
147 | @@ -1,9 +1,12 @@ | |
|
148 | + | |
|
149 | + | |
|
150 | 1 | |
|
151 | 2 | |
|
152 | 3 | |
|
153 | 4 | |
|
154 | -hello world | |
|
155 | -goodbye world | |
|
156 | +hello world | |
|
157 | + goodbye world | |
|
158 | 7 | |
|
159 | 8 | |
|
160 | 9 | |
|
161 | +a | |
|
65 | 162 | |
|
66 | echo % qdiff preserve existing git flag | |
|
67 | hg qrefresh --git | |
|
68 | echo a >> lines | |
|
69 | hg qdiff | |
|
163 | $ hg qdiff --stat | |
|
164 | lines | 7 +++++-- | |
|
165 | 1 files changed, 5 insertions(+), 2 deletions(-) | |
|
70 | 166 | |
|
71 | echo % qdiff --stat | |
|
72 | hg qdiff --stat |
@@ -1,66 +1,144 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "mq=" >> $HGRCPATH | |
|
3 | $ echo "[mq]" >> $HGRCPATH | |
|
4 | $ echo "git=keep" >> $HGRCPATH | |
|
5 | $ echo "[diff]" >> $HGRCPATH | |
|
6 | $ echo "nodates=1" >> $HGRCPATH | |
|
7 | ||
|
8 | init: | |
|
2 | 9 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
5 | echo "[mq]" >> $HGRCPATH | |
|
6 | echo "git=keep" >> $HGRCPATH | |
|
10 | $ hg init repo | |
|
11 | $ cd repo | |
|
12 | $ echo a > a | |
|
13 | $ hg ci -Am adda | |
|
14 | adding a | |
|
15 | $ echo a >> a | |
|
16 | $ hg qnew -f p1 | |
|
17 | $ echo b >> a | |
|
18 | $ hg qnew -f p2 | |
|
19 | $ echo c >> a | |
|
20 | $ hg qnew -f p3 | |
|
21 | ||
|
22 | Fold in the middle of the queue: | |
|
23 | ||
|
24 | $ hg qpop p1 | |
|
25 | popping p3 | |
|
26 | popping p2 | |
|
27 | now at: p1 | |
|
28 | ||
|
29 | $ hg qdiff | |
|
30 | diff -r 07f494440405 a | |
|
31 | --- a/a | |
|
32 | +++ b/a | |
|
33 | @@ -1,1 +1,2 @@ | |
|
34 | a | |
|
35 | +a | |
|
7 | 36 | |
|
8 | filterdiff() | |
|
9 | { | |
|
10 | grep -v diff | \ | |
|
11 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
12 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
13 | } | |
|
37 | $ hg qfold p2 | |
|
38 | $ grep git .hg/patches/p1 && echo 'git patch found!' | |
|
39 | [1] | |
|
40 | ||
|
41 | $ hg qser | |
|
42 | p1 | |
|
43 | p3 | |
|
44 | ||
|
45 | $ hg qdiff | |
|
46 | diff -r 07f494440405 a | |
|
47 | --- a/a | |
|
48 | +++ b/a | |
|
49 | @@ -1,1 +1,3 @@ | |
|
50 | a | |
|
51 | +a | |
|
52 | +b | |
|
14 | 53 | |
|
15 | filterpatch() | |
|
16 | { | |
|
17 | sed -e "s/\(# Parent \).*/\1/" | |
|
18 | } | |
|
54 | Fold with local changes: | |
|
55 | ||
|
56 | $ echo d >> a | |
|
57 | $ hg qfold p3 | |
|
58 | abort: local changes found, refresh first | |
|
59 | [255] | |
|
60 | ||
|
61 | $ hg diff -c . | |
|
62 | diff -r 07f494440405 -r ............ a | |
|
63 | --- a/a | |
|
64 | +++ b/a | |
|
65 | @@ -1,1 +1,3 @@ | |
|
66 | a | |
|
67 | +a | |
|
68 | +b | |
|
69 | ||
|
70 | $ hg revert -a --no-backup | |
|
71 | reverting a | |
|
19 | 72 | |
|
20 | echo '% init' | |
|
21 | hg init repo | |
|
22 | cd repo | |
|
23 | echo a > a | |
|
24 | hg ci -Am adda | |
|
25 | echo a >> a | |
|
26 | hg qnew -f p1 | |
|
27 | echo b >> a | |
|
28 | hg qnew -f p2 | |
|
29 | echo c >> a | |
|
30 | hg qnew -f p3 | |
|
31 | echo '% fold in the middle of the queue' | |
|
32 | hg qpop p1 | |
|
33 | hg qdiff | filterdiff | |
|
34 | hg qfold p2 | |
|
35 | grep git .hg/patches/p1 && echo 'git patch found!' | |
|
36 | hg qser | |
|
37 | hg qdiff | filterdiff | |
|
38 | echo '% fold with local changes' | |
|
39 | echo d >> a | |
|
40 | hg qfold p3 | |
|
41 | hg diff -c . | filterdiff | |
|
42 | hg revert -a --no-backup | |
|
73 | Fold git patch into a regular patch, expect git patch: | |
|
74 | ||
|
75 | $ echo a >> a | |
|
76 | $ hg qnew -f regular | |
|
77 | $ hg cp a aa | |
|
78 | $ hg qnew --git -f git | |
|
79 | ||
|
80 | $ hg qpop | |
|
81 | popping git | |
|
82 | now at: regular | |
|
83 | ||
|
84 | $ hg qfold git | |
|
85 | ||
|
86 | $ cat .hg/patches/regular | |
|
87 | # HG changeset patch | |
|
88 | # Parent ........................................ | |
|
89 | ||
|
90 | diff --git a/a b/a | |
|
91 | --- a/a | |
|
92 | +++ b/a | |
|
93 | @@ -1,3 +1,4 @@ | |
|
94 | a | |
|
95 | a | |
|
96 | b | |
|
97 | +a | |
|
98 | diff --git a/a b/aa | |
|
99 | copy from a | |
|
100 | copy to aa | |
|
101 | --- a/a | |
|
102 | +++ b/aa | |
|
103 | @@ -1,3 +1,4 @@ | |
|
104 | a | |
|
105 | a | |
|
106 | b | |
|
107 | +a | |
|
43 | 108 | |
|
44 | echo '% fold git patch into a regular patch, expect git patch' | |
|
45 | echo a >> a | |
|
46 | hg qnew -f regular | |
|
47 | hg cp a aa | |
|
48 | hg qnew --git -f git | |
|
49 | hg qpop | |
|
50 | hg qfold git | |
|
51 | cat .hg/patches/regular | filterpatch | |
|
52 | hg qpop | |
|
53 | hg qdel regular | |
|
109 | $ hg qpop | |
|
110 | popping regular | |
|
111 | now at: p1 | |
|
112 | ||
|
113 | $ hg qdel regular | |
|
114 | ||
|
115 | Fold regular patch into a git patch, expect git patch: | |
|
116 | ||
|
117 | $ hg cp a aa | |
|
118 | $ hg qnew --git -f git | |
|
119 | $ echo b >> aa | |
|
120 | $ hg qnew -f regular | |
|
121 | ||
|
122 | $ hg qpop | |
|
123 | popping regular | |
|
124 | now at: git | |
|
54 | 125 | |
|
55 | echo '% fold regular patch into a git patch, expect git patch' | |
|
56 | hg cp a aa | |
|
57 | hg qnew --git -f git | |
|
58 | echo b >> aa | |
|
59 | hg qnew -f regular | |
|
60 | hg qpop | |
|
61 | hg qfold regular | |
|
62 | cat .hg/patches/git | filterpatch | |
|
126 | $ hg qfold regular | |
|
63 | 127 | |
|
64 | cd .. | |
|
128 | $ cat .hg/patches/git | |
|
129 | # HG changeset patch | |
|
130 | # Parent ........................................ | |
|
131 | ||
|
132 | diff --git a/a b/aa | |
|
133 | copy from a | |
|
134 | copy to aa | |
|
135 | --- a/a | |
|
136 | +++ b/aa | |
|
137 | @@ -1,3 +1,4 @@ | |
|
138 | a | |
|
139 | a | |
|
140 | b | |
|
141 | +b | |
|
65 | 142 | |
|
143 | $ cd .. | |
|
66 | 144 |
@@ -1,49 +1,77 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "mq=" >> $HGRCPATH | |
|
2 | 3 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
4 | $ hg init a | |
|
5 | $ cd a | |
|
6 | $ echo a > a | |
|
7 | $ hg ci -Ama | |
|
8 | adding a | |
|
5 | 9 | |
|
6 | hg init a | |
|
7 | cd a | |
|
8 | echo a > a | |
|
9 | hg ci -Ama | |
|
10 | $ hg qnew a.patch | |
|
11 | $ echo a >> a | |
|
12 | $ hg qrefresh | |
|
13 | ||
|
14 | $ hg qnew b.patch | |
|
15 | $ echo b > b | |
|
16 | $ hg add b | |
|
17 | $ hg qrefresh | |
|
10 | 18 | |
|
11 |
hg qnew |
|
|
12 |
|
|
|
13 | hg qrefresh | |
|
19 | $ hg qnew c.patch | |
|
20 | $ echo c > c | |
|
21 | $ hg add c | |
|
22 | $ hg qrefresh | |
|
23 | ||
|
24 | $ hg qgoto a.patch | |
|
25 | popping c.patch | |
|
26 | popping b.patch | |
|
27 | now at: a.patch | |
|
14 | 28 | |
|
15 |
|
|
|
16 | echo b > b | |
|
17 | hg add b | |
|
18 | hg qrefresh | |
|
29 | $ hg qgoto c.patch | |
|
30 | applying b.patch | |
|
31 | applying c.patch | |
|
32 | now at: c.patch | |
|
19 | 33 | |
|
20 |
|
|
|
21 | echo c > c | |
|
22 | hg add c | |
|
23 | hg qrefresh | |
|
34 | $ hg qgoto b.patch | |
|
35 | popping c.patch | |
|
36 | now at: b.patch | |
|
37 | ||
|
38 | Using index: | |
|
24 | 39 | |
|
25 |
hg qgoto |
|
|
26 | hg qgoto c.patch | |
|
27 |
|
|
|
40 | $ hg qgoto 0 | |
|
41 | popping b.patch | |
|
42 | now at: a.patch | |
|
43 | ||
|
44 | $ hg qgoto 2 | |
|
45 | applying b.patch | |
|
46 | applying c.patch | |
|
47 | now at: c.patch | |
|
28 | 48 | |
|
29 | echo | |
|
30 | echo % Using index | |
|
31 | hg qgoto 0 | |
|
32 | hg qgoto 2 | |
|
49 | No warnings when using index: | |
|
50 | ||
|
51 | $ hg qnew bug314159 | |
|
52 | $ echo d >> c | |
|
53 | $ hg qrefresh | |
|
54 | $ hg qnew bug141421 | |
|
55 | $ echo e >> c | |
|
56 | $ hg qrefresh | |
|
33 | 57 | |
|
34 | echo | |
|
35 | echo % No warnings when using index | |
|
36 |
|
|
|
37 | echo d >> c | |
|
38 | hg qrefresh | |
|
39 | hg qnew bug141421 | |
|
40 | echo e >> c | |
|
41 | hg qrefresh | |
|
42 | hg qgoto 1 | |
|
43 | hg qgoto 3 | |
|
58 | $ hg qgoto 1 | |
|
59 | popping bug141421 | |
|
60 | popping bug314159 | |
|
61 | popping c.patch | |
|
62 | now at: b.patch | |
|
44 | 63 | |
|
45 | echo | |
|
46 | echo % Detect ambiguous non-index | |
|
47 | hg qgoto 14 | |
|
64 | $ hg qgoto 3 | |
|
65 | applying c.patch | |
|
66 | applying bug314159 | |
|
67 | now at: bug314159 | |
|
68 | ||
|
69 | Detect ambiguous non-index: | |
|
48 | 70 | |
|
49 | exit 0 | |
|
71 | $ hg qgoto 14 | |
|
72 | patch name "14" is ambiguous: | |
|
73 | bug314159 | |
|
74 | bug141421 | |
|
75 | abort: patch 14 not in series | |
|
76 | [255] | |
|
77 |
@@ -1,101 +1,188 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "mq=" >> $HGRCPATH | |
|
2 | 3 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
4 | $ hg init foo | |
|
5 | $ cd foo | |
|
6 | $ echo a > a | |
|
7 | $ hg ci -qAm a | |
|
8 | ||
|
9 | Default queue: | |
|
5 | 10 | |
|
6 | hg init foo | |
|
7 | cd foo | |
|
8 | echo a > a | |
|
9 | hg ci -qAm a | |
|
11 | $ hg qqueue | |
|
12 | patches (active) | |
|
13 | ||
|
14 | $ echo b > a | |
|
15 | $ hg qnew -fgDU somestuff | |
|
16 | ||
|
17 | Applied patches in default queue: | |
|
18 | ||
|
19 | $ hg qap | |
|
20 | somestuff | |
|
21 | ||
|
22 | Try to change patch (create succeeds, switch fails): | |
|
10 | 23 | |
|
11 | echo %% default queue | |
|
12 | hg qqueue | |
|
24 | $ hg qqueue foo --create | |
|
25 | abort: patches applied - cannot set new queue active | |
|
26 | [255] | |
|
13 | 27 | |
|
14 | echo b > a | |
|
15 | hg qnew -fgDU somestuff | |
|
28 | $ hg qqueue | |
|
29 | foo | |
|
30 | patches (active) | |
|
31 | ||
|
32 | Empty default queue: | |
|
16 | 33 | |
|
17 | echo %% applied patches in default queue | |
|
18 | hg qap | |
|
34 | $ hg qpop | |
|
35 | popping somestuff | |
|
36 | patch queue now empty | |
|
37 | ||
|
38 | Switch queue: | |
|
19 | 39 | |
|
20 | echo %% try to change patch \(create succeeds, switch fails\) | |
|
21 | hg qqueue foo --create | |
|
22 | hg qqueue | |
|
40 | $ hg qqueue foo | |
|
41 | $ hg qqueue | |
|
42 | foo (active) | |
|
43 | patches | |
|
44 | ||
|
45 | List queues, quiet: | |
|
23 | 46 | |
|
24 | echo %% empty default queue | |
|
25 | hg qpop | |
|
47 | $ hg qqueue --quiet | |
|
48 | foo | |
|
49 | patches | |
|
26 | 50 | |
|
27 | echo %% switch queue | |
|
28 | hg qqueue foo | |
|
29 | hg qqueue | |
|
51 | Fail creating queue with already existing name: | |
|
52 | ||
|
53 | $ hg qqueue --create foo | |
|
54 | abort: queue "foo" already exists | |
|
55 | [255] | |
|
30 | 56 | |
|
31 | echo %% list queues, quiet | |
|
32 | hg qqueue --quiet | |
|
57 | $ hg qqueue | |
|
58 | foo (active) | |
|
59 | patches | |
|
60 | ||
|
61 | Create new queue for rename: | |
|
33 | 62 | |
|
34 | echo %% fail creating queue with already existing name | |
|
35 | hg qqueue --create foo | |
|
36 | hg qqueue | |
|
63 | $ hg qqueue --create bar | |
|
64 | ||
|
65 | $ hg qqueue | |
|
66 | bar (active) | |
|
67 | foo | |
|
68 | patches | |
|
37 | 69 | |
|
38 | echo %% create new queue for rename | |
|
39 | hg qqueue --create bar | |
|
40 | hg qqueue | |
|
70 | Rename queue, same name: | |
|
41 | 71 | |
|
42 | echo %% rename queue, same name | |
|
43 | hg qqueue --rename bar | |
|
72 | $ hg qqueue --rename bar | |
|
73 | abort: can't rename "bar" to its current name | |
|
74 | [255] | |
|
75 | ||
|
76 | Rename queue to existing: | |
|
44 | 77 | |
|
45 | echo %% rename queue to existing | |
|
46 | hg qqueue --rename foo | |
|
78 | $ hg qqueue --rename foo | |
|
79 | abort: queue "foo" already exists | |
|
80 | [255] | |
|
81 | ||
|
82 | Rename queue: | |
|
47 | 83 | |
|
48 | echo %% rename queue | |
|
49 | hg qqueue --rename buz | |
|
50 | hg qqueue | |
|
84 | $ hg qqueue --rename buz | |
|
85 | ||
|
86 | $ hg qqueue | |
|
87 | buz (active) | |
|
88 | foo | |
|
89 | patches | |
|
90 | ||
|
91 | Switch back to previous queue: | |
|
51 | 92 | |
|
52 | echo %% switch back to previous queue | |
|
53 | hg qqueue foo | |
|
54 | hg qqueue --delete buz | |
|
55 | hg qqueue | |
|
93 | $ hg qqueue foo | |
|
94 | $ hg qqueue --delete buz | |
|
95 | ||
|
96 | $ hg qqueue | |
|
97 | foo (active) | |
|
98 | patches | |
|
99 | ||
|
100 | Create queue for purge: | |
|
101 | ||
|
102 | $ hg qqueue --create purge-me | |
|
56 | 103 | |
|
57 | echo %% create queue for purge | |
|
58 | hg qqueue --create purge-me | |
|
59 | hg qqueue | |
|
104 | $ hg qqueue | |
|
105 | foo | |
|
106 | patches | |
|
107 | purge-me (active) | |
|
108 | ||
|
109 | Create patch for purge: | |
|
110 | ||
|
111 | $ hg qnew patch-purge-me | |
|
112 | ||
|
113 | $ ls -1d .hg/patches-purge-me 2>/dev/null || true | |
|
114 | .hg/patches-purge-me | |
|
60 | 115 | |
|
61 | echo %% create patch for purge | |
|
62 |
|
|
|
63 | ls -1d .hg/patches-purge-me 2>/dev/null || true | |
|
64 | hg qpop -a | |
|
116 | $ hg qpop -a | |
|
117 | popping patch-purge-me | |
|
118 | patch queue now empty | |
|
119 | ||
|
120 | Purge queue: | |
|
121 | ||
|
122 | $ hg qqueue foo | |
|
123 | $ hg qqueue --purge purge-me | |
|
65 | 124 | |
|
66 | echo %% purge queue | |
|
67 | hg qqueue foo | |
|
68 | hg qqueue --purge purge-me | |
|
69 | hg qqueue | |
|
70 | ls -1d .hg/patches-purge-me 2>/dev/null || true | |
|
125 | $ hg qqueue | |
|
126 | foo (active) | |
|
127 | patches | |
|
128 | ||
|
129 | $ ls -1d .hg/patches-purge-me 2>/dev/null || true | |
|
71 | 130 | |
|
72 |
|
|
|
73 | hg qun | |
|
74 | echo c > a | |
|
75 | hg qnew -fgDU otherstuff | |
|
131 | Unapplied patches: | |
|
132 | ||
|
133 | $ hg qun | |
|
134 | $ echo c > a | |
|
135 | $ hg qnew -fgDU otherstuff | |
|
136 | ||
|
137 | Fail switching back: | |
|
76 | 138 | |
|
77 | echo %% fail switching back | |
|
78 | hg qqueue patches | |
|
139 | $ hg qqueue patches | |
|
140 | abort: patches applied - cannot set new queue active | |
|
141 | [255] | |
|
79 | 142 | |
|
80 |
|
|
|
81 | hg qqueue foo --delete | |
|
143 | Fail deleting current: | |
|
144 | ||
|
145 | $ hg qqueue foo --delete | |
|
146 | abort: cannot delete currently active queue | |
|
147 | [255] | |
|
82 | 148 | |
|
83 |
|
|
|
84 | hg qpop -a | |
|
85 | hg qqueue patches | |
|
86 | hg qqueue foo --delete | |
|
87 | hg qqueue | |
|
149 | Switch back and delete foo: | |
|
150 | ||
|
151 | $ hg qpop -a | |
|
152 | popping otherstuff | |
|
153 | patch queue now empty | |
|
154 | ||
|
155 | $ hg qqueue patches | |
|
156 | $ hg qqueue foo --delete | |
|
157 | $ hg qqueue | |
|
158 | patches (active) | |
|
159 | ||
|
160 | Tricky cases: | |
|
88 | 161 | |
|
89 | echo %% tricky cases | |
|
90 | hg qqueue store --create | |
|
91 | hg qnew journal | |
|
92 | hg qqueue | |
|
93 | hg qpop -a | |
|
94 | hg qqueue patches | |
|
95 | hg qun | |
|
162 | $ hg qqueue store --create | |
|
163 | $ hg qnew journal | |
|
164 | ||
|
165 | $ hg qqueue | |
|
166 | patches | |
|
167 | store (active) | |
|
168 | ||
|
169 | $ hg qpop -a | |
|
170 | popping journal | |
|
171 | patch queue now empty | |
|
96 | 172 | |
|
97 | echo %% invalid names | |
|
98 | hg qqueue test/../../bar --create | |
|
99 | hg qqueue . --create | |
|
173 | $ hg qqueue patches | |
|
174 | $ hg qun | |
|
175 | somestuff | |
|
176 | ||
|
177 | Invalid names: | |
|
100 | 178 | |
|
101 | cd .. | |
|
179 | $ hg qqueue test/../../bar --create | |
|
180 | abort: invalid queue name, may not contain the characters ":\/." | |
|
181 | [255] | |
|
182 | ||
|
183 | $ hg qqueue . --create | |
|
184 | abort: invalid queue name, may not contain the characters ":\/." | |
|
185 | [255] | |
|
186 | ||
|
187 | $ cd .. | |
|
188 |
This diff has been collapsed as it changes many lines, (648 lines changed) Show them Hide them | |||
@@ -1,198 +1,488 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "mq=" >> $HGRCPATH | |
|
3 | $ echo "[diff]" >> $HGRCPATH | |
|
4 | $ echo "nodates=1" >> $HGRCPATH | |
|
2 | 5 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
5 | ||
|
6 | catpatch() { | |
|
7 | cat $1 | sed -e "s/^\(# Parent \).*/\1/" | |
|
8 | } | |
|
6 | $ hg init a | |
|
7 | $ cd a | |
|
9 | 8 | |
|
10 | echo % init | |
|
11 | hg init a | |
|
12 | cd a | |
|
9 | $ mkdir 1 2 | |
|
10 | $ echo 'base' > 1/base | |
|
11 | $ echo 'base' > 2/base | |
|
12 | $ hg ci -Ambase | |
|
13 | adding 1/base | |
|
14 | adding 2/base | |
|
13 | 15 | |
|
14 | echo % commit | |
|
15 | mkdir 1 2 | |
|
16 | echo 'base' > 1/base | |
|
17 | echo 'base' > 2/base | |
|
18 | hg ci -Ambase -d '1 0' | |
|
16 | $ hg qnew -mmqbase mqbase | |
|
19 | 17 | |
|
20 | echo % qnew mqbase | |
|
21 | hg qnew -mmqbase mqbase | |
|
18 | $ echo 'patched' > 1/base | |
|
19 | $ echo 'patched' > 2/base | |
|
20 | $ hg qrefresh | |
|
22 | 21 | |
|
23 | echo % qrefresh | |
|
24 | echo 'patched' > 1/base | |
|
25 | echo 'patched' > 2/base | |
|
26 | hg qrefresh | |
|
27 | ||
|
28 | echo % qdiff | |
|
29 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
30 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
22 | $ hg qdiff | |
|
23 | diff -r e7af5904b465 1/base | |
|
24 | --- a/1/base | |
|
25 | +++ b/1/base | |
|
26 | @@ -1,1 +1,1 @@ | |
|
27 | -base | |
|
28 | +patched | |
|
29 | diff -r e7af5904b465 2/base | |
|
30 | --- a/2/base | |
|
31 | +++ b/2/base | |
|
32 | @@ -1,1 +1,1 @@ | |
|
33 | -base | |
|
34 | +patched | |
|
31 | 35 | |
|
32 | echo % qdiff dirname | |
|
33 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
34 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
35 | ||
|
36 | echo % patch file contents | |
|
37 | catpatch .hg/patches/mqbase | \ | |
|
38 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
39 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
40 | ||
|
41 | echo % qrefresh 1 | |
|
42 | echo 'patched again' > base | |
|
43 | hg qrefresh 1 | |
|
36 | $ hg qdiff . | |
|
37 | diff -r e7af5904b465 1/base | |
|
38 | --- a/1/base | |
|
39 | +++ b/1/base | |
|
40 | @@ -1,1 +1,1 @@ | |
|
41 | -base | |
|
42 | +patched | |
|
43 | diff -r e7af5904b465 2/base | |
|
44 | --- a/2/base | |
|
45 | +++ b/2/base | |
|
46 | @@ -1,1 +1,1 @@ | |
|
47 | -base | |
|
48 | +patched | |
|
44 | 49 | |
|
45 | echo % qdiff | |
|
46 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
47 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
48 | ||
|
49 | echo % qdiff dirname | |
|
50 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
51 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
50 | $ cat .hg/patches/mqbase | |
|
51 | # HG changeset patch | |
|
52 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
53 | mqbase | |
|
54 | ||
|
55 | diff -r e7af5904b465 1/base | |
|
56 | --- a/1/base | |
|
57 | +++ b/1/base | |
|
58 | @@ -1,1 +1,1 @@ | |
|
59 | -base | |
|
60 | +patched | |
|
61 | diff -r e7af5904b465 2/base | |
|
62 | --- a/2/base | |
|
63 | +++ b/2/base | |
|
64 | @@ -1,1 +1,1 @@ | |
|
65 | -base | |
|
66 | +patched | |
|
52 | 67 | |
|
53 | echo % patch file contents | |
|
54 | catpatch .hg/patches/mqbase | \ | |
|
55 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
56 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
57 | ||
|
58 | echo % qrefresh . in subdir | |
|
59 | ( cd 1 ; hg qrefresh . ) | |
|
60 | ||
|
61 | echo % qdiff | |
|
62 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
63 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
68 | $ echo 'patched again' > base | |
|
69 | $ hg qrefresh 1 | |
|
64 | 70 | |
|
65 | echo % qdiff dirname | |
|
66 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
67 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
68 | ||
|
69 | echo % patch file contents | |
|
70 | catpatch .hg/patches/mqbase | \ | |
|
71 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
72 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
73 | ||
|
74 | echo % qrefresh in hg-root again | |
|
75 | hg qrefresh | |
|
71 | $ hg qdiff | |
|
72 | diff -r e7af5904b465 1/base | |
|
73 | --- a/1/base | |
|
74 | +++ b/1/base | |
|
75 | @@ -1,1 +1,1 @@ | |
|
76 | -base | |
|
77 | +patched | |
|
78 | diff -r e7af5904b465 2/base | |
|
79 | --- a/2/base | |
|
80 | +++ b/2/base | |
|
81 | @@ -1,1 +1,1 @@ | |
|
82 | -base | |
|
83 | +patched | |
|
76 | 84 | |
|
77 | echo % qdiff | |
|
78 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
79 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
80 | ||
|
81 | echo % qdiff dirname | |
|
82 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
83 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
84 | ||
|
85 | echo % patch file contents | |
|
86 | catpatch .hg/patches/mqbase | \ | |
|
87 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
88 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
85 | $ hg qdiff . | |
|
86 | diff -r e7af5904b465 1/base | |
|
87 | --- a/1/base | |
|
88 | +++ b/1/base | |
|
89 | @@ -1,1 +1,1 @@ | |
|
90 | -base | |
|
91 | +patched | |
|
92 | diff -r e7af5904b465 2/base | |
|
93 | --- a/2/base | |
|
94 | +++ b/2/base | |
|
95 | @@ -1,1 +1,1 @@ | |
|
96 | -base | |
|
97 | +patched | |
|
89 | 98 | |
|
90 | echo | |
|
91 | echo % qrefresh --short tests: | |
|
92 | echo 'orphan' > orphanchild | |
|
93 | hg add orphanchild | |
|
94 | ||
|
95 | echo % - add 1/base and 2/base one by one | |
|
96 | hg qrefresh nonexistingfilename # clear patch | |
|
97 | hg qrefresh --short 1/base | |
|
98 | hg qrefresh --short 2/base | |
|
99 | $ cat .hg/patches/mqbase | |
|
100 | # HG changeset patch | |
|
101 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
102 | mqbase | |
|
103 | ||
|
104 | diff -r e7af5904b465 1/base | |
|
105 | --- a/1/base | |
|
106 | +++ b/1/base | |
|
107 | @@ -1,1 +1,1 @@ | |
|
108 | -base | |
|
109 | +patched | |
|
99 | 110 | |
|
100 | echo % -- qdiff output | |
|
101 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
102 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
111 | qrefresh . in subdir: | |
|
103 | 112 | |
|
104 | echo % -- patch file content | |
|
105 | catpatch .hg/patches/mqbase | \ | |
|
106 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
107 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" | |
|
108 | hg st | |
|
113 | $ ( cd 1 ; hg qrefresh . ) | |
|
109 | 114 | |
|
110 | echo % -- diff shows what is not in patch | |
|
111 | hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
112 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
|
113 | -e "s/^\(diff\).*/\1/" | |
|
114 | echo % - before starting exclusive tests | |
|
115 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase | |
|
116 | echo % - exclude 2/base | |
|
117 | hg qref -s -X 2/base | |
|
118 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase | |
|
119 | echo % -- status shows 2/base as dirty | |
|
120 | hg st | |
|
121 | echo % - remove 1/base and add 2/base again but not orphanchild | |
|
122 | hg qref -s -X orphanchild -X 1/base 2/base orphanchild | |
|
123 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase | |
|
124 | echo % - add 1/base with include filter - and thus remove 2/base from patch | |
|
125 | hg qref -s -I 1/ o* */* | |
|
126 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase | |
|
127 | echo | |
|
128 | cd .. | |
|
115 | $ hg qdiff | |
|
116 | diff -r e7af5904b465 1/base | |
|
117 | --- a/1/base | |
|
118 | +++ b/1/base | |
|
119 | @@ -1,1 +1,1 @@ | |
|
120 | -base | |
|
121 | +patched | |
|
122 | diff -r e7af5904b465 2/base | |
|
123 | --- a/2/base | |
|
124 | +++ b/2/base | |
|
125 | @@ -1,1 +1,1 @@ | |
|
126 | -base | |
|
127 | +patched | |
|
128 | ||
|
129 | $ hg qdiff . | |
|
130 | diff -r e7af5904b465 1/base | |
|
131 | --- a/1/base | |
|
132 | +++ b/1/base | |
|
133 | @@ -1,1 +1,1 @@ | |
|
134 | -base | |
|
135 | +patched | |
|
136 | diff -r e7af5904b465 2/base | |
|
137 | --- a/2/base | |
|
138 | +++ b/2/base | |
|
139 | @@ -1,1 +1,1 @@ | |
|
140 | -base | |
|
141 | +patched | |
|
129 | 142 | |
|
130 | # Test qrefresh --git losing copy metadata | |
|
131 | echo % create test repo | |
|
132 | hg init repo | |
|
133 | cd repo | |
|
134 | echo "[diff]" >> .hg/hgrc | |
|
135 | echo "git=True" >> .hg/hgrc | |
|
136 | echo a > a | |
|
137 | hg ci -Am adda | |
|
138 | hg copy a ab | |
|
139 | echo b >> ab | |
|
140 | hg copy a ac | |
|
141 | echo c >> ac | |
|
142 | echo % capture changes | |
|
143 | hg qnew -f p1 | |
|
144 | hg qdiff | |
|
145 | echo % refresh and check changes again | |
|
146 | hg qref | |
|
147 | hg qdiff | |
|
148 | cd .. | |
|
143 | $ cat .hg/patches/mqbase | |
|
144 | # HG changeset patch | |
|
145 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
146 | mqbase | |
|
147 | ||
|
148 | diff -r e7af5904b465 1/base | |
|
149 | --- a/1/base | |
|
150 | +++ b/1/base | |
|
151 | @@ -1,1 +1,1 @@ | |
|
152 | -base | |
|
153 | +patched | |
|
154 | ||
|
155 | qrefresh in hg-root again: | |
|
156 | ||
|
157 | $ hg qrefresh | |
|
158 | ||
|
159 | $ hg qdiff | |
|
160 | diff -r e7af5904b465 1/base | |
|
161 | --- a/1/base | |
|
162 | +++ b/1/base | |
|
163 | @@ -1,1 +1,1 @@ | |
|
164 | -base | |
|
165 | +patched | |
|
166 | diff -r e7af5904b465 2/base | |
|
167 | --- a/2/base | |
|
168 | +++ b/2/base | |
|
169 | @@ -1,1 +1,1 @@ | |
|
170 | -base | |
|
171 | +patched | |
|
149 | 172 | |
|
150 | # Test issue 1441: qrefresh confused after hg rename | |
|
151 | echo % issue1441 without git patches | |
|
152 | hg init repo-1441 | |
|
153 | cd repo-1441 | |
|
154 | echo a > a | |
|
155 | hg add a | |
|
156 | hg qnew -f p | |
|
157 | hg mv a b | |
|
158 | hg qrefresh | |
|
159 | hg qdiff --nodates | |
|
160 | cd .. | |
|
173 | $ hg qdiff . | |
|
174 | diff -r e7af5904b465 1/base | |
|
175 | --- a/1/base | |
|
176 | +++ b/1/base | |
|
177 | @@ -1,1 +1,1 @@ | |
|
178 | -base | |
|
179 | +patched | |
|
180 | diff -r e7af5904b465 2/base | |
|
181 | --- a/2/base | |
|
182 | +++ b/2/base | |
|
183 | @@ -1,1 +1,1 @@ | |
|
184 | -base | |
|
185 | +patched | |
|
161 | 186 | |
|
162 | echo '% issue2025: qrefresh does not honor filtering options when tip != qtip' | |
|
163 | hg init repo-2025 | |
|
164 | cd repo-2025 | |
|
165 | echo a > a | |
|
166 | echo b > b | |
|
167 | hg ci -qAm addab | |
|
168 | echo a >> a | |
|
169 | echo b >> b | |
|
170 | hg qnew -f patch | |
|
171 | hg up -qC 0 | |
|
172 | echo c > c | |
|
173 | hg ci -qAm addc | |
|
174 | hg up -qC 1 | |
|
175 | echo '% refresh with tip != qtip' | |
|
176 | hg --config diff.nodates=1 qrefresh -I b 2>&1 \ | |
|
177 | | sed 's/saving bundle.*/saving bundle.../g' | |
|
178 | echo '% status after refresh' | |
|
179 | hg st | |
|
180 | echo '% b after refresh' | |
|
181 | cat b | |
|
182 | echo '% patch file after refresh' | |
|
183 | catpatch .hg/patches/patch | |
|
184 | cd .. | |
|
187 | $ cat .hg/patches/mqbase | |
|
188 | # HG changeset patch | |
|
189 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
190 | mqbase | |
|
191 | ||
|
192 | diff -r e7af5904b465 1/base | |
|
193 | --- a/1/base | |
|
194 | +++ b/1/base | |
|
195 | @@ -1,1 +1,1 @@ | |
|
196 | -base | |
|
197 | +patched | |
|
198 | diff -r e7af5904b465 2/base | |
|
199 | --- a/2/base | |
|
200 | +++ b/2/base | |
|
201 | @@ -1,1 +1,1 @@ | |
|
202 | -base | |
|
203 | +patched | |
|
185 | 204 | |
|
186 | 205 | |
|
187 | echo % issue1441 with git patches | |
|
188 | hg init repo-1441-git | |
|
189 | cd repo-1441-git | |
|
190 | echo "[diff]" >> .hg/hgrc | |
|
191 | echo "git=True" >> .hg/hgrc | |
|
192 | echo a > a | |
|
193 | hg add a | |
|
194 | hg qnew -f p | |
|
195 | hg mv a b | |
|
196 | hg qrefresh | |
|
197 | hg qdiff --nodates | |
|
198 | cd .. | |
|
206 | qrefresh --short tests: | |
|
207 | ||
|
208 | $ echo 'orphan' > orphanchild | |
|
209 | $ hg add orphanchild | |
|
210 | $ hg qrefresh nonexistingfilename # clear patch | |
|
211 | $ hg qrefresh --short 1/base | |
|
212 | $ hg qrefresh --short 2/base | |
|
213 | ||
|
214 | $ hg qdiff | |
|
215 | diff -r e7af5904b465 1/base | |
|
216 | --- a/1/base | |
|
217 | +++ b/1/base | |
|
218 | @@ -1,1 +1,1 @@ | |
|
219 | -base | |
|
220 | +patched | |
|
221 | diff -r e7af5904b465 2/base | |
|
222 | --- a/2/base | |
|
223 | +++ b/2/base | |
|
224 | @@ -1,1 +1,1 @@ | |
|
225 | -base | |
|
226 | +patched | |
|
227 | diff -r e7af5904b465 orphanchild | |
|
228 | --- /dev/null | |
|
229 | +++ b/orphanchild | |
|
230 | @@ -0,0 +1,1 @@ | |
|
231 | +orphan | |
|
232 | ||
|
233 | $ cat .hg/patches/mqbase | |
|
234 | # HG changeset patch | |
|
235 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
236 | mqbase | |
|
237 | ||
|
238 | diff -r e7af5904b465 1/base | |
|
239 | --- a/1/base | |
|
240 | +++ b/1/base | |
|
241 | @@ -1,1 +1,1 @@ | |
|
242 | -base | |
|
243 | +patched | |
|
244 | diff -r e7af5904b465 2/base | |
|
245 | --- a/2/base | |
|
246 | +++ b/2/base | |
|
247 | @@ -1,1 +1,1 @@ | |
|
248 | -base | |
|
249 | +patched | |
|
250 | ||
|
251 | $ hg st | |
|
252 | A orphanchild | |
|
253 | ? base | |
|
254 | ||
|
255 | diff shows what is not in patch: | |
|
256 | ||
|
257 | $ hg diff | |
|
258 | diff -r ............ orphanchild | |
|
259 | --- /dev/null | |
|
260 | +++ b/orphanchild | |
|
261 | @@ -0,0 +1,1 @@ | |
|
262 | +orphan | |
|
263 | ||
|
264 | Before starting exclusive tests: | |
|
265 | ||
|
266 | $ cat .hg/patches/mqbase | |
|
267 | # HG changeset patch | |
|
268 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
269 | mqbase | |
|
270 | ||
|
271 | diff -r e7af5904b465 1/base | |
|
272 | --- a/1/base | |
|
273 | +++ b/1/base | |
|
274 | @@ -1,1 +1,1 @@ | |
|
275 | -base | |
|
276 | +patched | |
|
277 | diff -r e7af5904b465 2/base | |
|
278 | --- a/2/base | |
|
279 | +++ b/2/base | |
|
280 | @@ -1,1 +1,1 @@ | |
|
281 | -base | |
|
282 | +patched | |
|
283 | ||
|
284 | Exclude 2/base: | |
|
285 | ||
|
286 | $ hg qref -s -X 2/base | |
|
287 | ||
|
288 | $ cat .hg/patches/mqbase | |
|
289 | # HG changeset patch | |
|
290 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
291 | mqbase | |
|
292 | ||
|
293 | diff -r e7af5904b465 1/base | |
|
294 | --- a/1/base | |
|
295 | +++ b/1/base | |
|
296 | @@ -1,1 +1,1 @@ | |
|
297 | -base | |
|
298 | +patched | |
|
299 | ||
|
300 | status shows 2/base as dirty: | |
|
301 | ||
|
302 | $ hg status | |
|
303 | M 2/base | |
|
304 | A orphanchild | |
|
305 | ? base | |
|
306 | ||
|
307 | Remove 1/base and add 2/base again but not orphanchild: | |
|
308 | ||
|
309 | $ hg qref -s -X orphanchild -X 1/base 2/base orphanchild | |
|
310 | ||
|
311 | $ cat .hg/patches/mqbase | |
|
312 | # HG changeset patch | |
|
313 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
314 | mqbase | |
|
315 | ||
|
316 | diff -r e7af5904b465 2/base | |
|
317 | --- a/2/base | |
|
318 | +++ b/2/base | |
|
319 | @@ -1,1 +1,1 @@ | |
|
320 | -base | |
|
321 | +patched | |
|
322 | ||
|
323 | Add 1/base with include filter - and thus remove 2/base from patch: | |
|
324 | ||
|
325 | $ hg qref -s -I 1/ o* */* | |
|
326 | ||
|
327 | $ cat .hg/patches/mqbase | |
|
328 | # HG changeset patch | |
|
329 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
|
330 | mqbase | |
|
331 | ||
|
332 | diff -r e7af5904b465 1/base | |
|
333 | --- a/1/base | |
|
334 | +++ b/1/base | |
|
335 | @@ -1,1 +1,1 @@ | |
|
336 | -base | |
|
337 | +patched | |
|
338 | ||
|
339 | $ cd .. | |
|
340 | ||
|
341 | ||
|
342 | Test qrefresh --git losing copy metadata: | |
|
343 | ||
|
344 | $ hg init repo | |
|
345 | $ cd repo | |
|
346 | ||
|
347 | $ echo "[diff]" >> .hg/hgrc | |
|
348 | $ echo "git=True" >> .hg/hgrc | |
|
349 | $ echo a > a | |
|
350 | ||
|
351 | $ hg ci -Am adda | |
|
352 | adding a | |
|
353 | $ hg copy a ab | |
|
354 | $ echo b >> ab | |
|
355 | $ hg copy a ac | |
|
356 | $ echo c >> ac | |
|
357 | ||
|
358 | Capture changes: | |
|
359 | ||
|
360 | $ hg qnew -f p1 | |
|
361 | ||
|
362 | $ hg qdiff | |
|
363 | diff --git a/a b/ab | |
|
364 | copy from a | |
|
365 | copy to ab | |
|
366 | --- a/a | |
|
367 | +++ b/ab | |
|
368 | @@ -1,1 +1,2 @@ | |
|
369 | a | |
|
370 | +b | |
|
371 | diff --git a/a b/ac | |
|
372 | copy from a | |
|
373 | copy to ac | |
|
374 | --- a/a | |
|
375 | +++ b/ac | |
|
376 | @@ -1,1 +1,2 @@ | |
|
377 | a | |
|
378 | +c | |
|
379 | ||
|
380 | Refresh and check changes again: | |
|
381 | ||
|
382 | $ hg qrefresh | |
|
383 | ||
|
384 | $ hg qdiff | |
|
385 | diff --git a/a b/ab | |
|
386 | copy from a | |
|
387 | copy to ab | |
|
388 | --- a/a | |
|
389 | +++ b/ab | |
|
390 | @@ -1,1 +1,2 @@ | |
|
391 | a | |
|
392 | +b | |
|
393 | diff --git a/a b/ac | |
|
394 | copy from a | |
|
395 | copy to ac | |
|
396 | --- a/a | |
|
397 | +++ b/ac | |
|
398 | @@ -1,1 +1,2 @@ | |
|
399 | a | |
|
400 | +c | |
|
401 | ||
|
402 | $ cd .. | |
|
403 | ||
|
404 | ||
|
405 | Test issue 1441: qrefresh confused after hg rename: | |
|
406 | ||
|
407 | $ hg init repo-1441 | |
|
408 | $ cd repo-1441 | |
|
409 | $ echo a > a | |
|
410 | $ hg add a | |
|
411 | $ hg qnew -f p | |
|
412 | $ hg mv a b | |
|
413 | $ hg qrefresh | |
|
414 | ||
|
415 | $ hg qdiff | |
|
416 | diff -r 000000000000 b | |
|
417 | --- /dev/null | |
|
418 | +++ b/b | |
|
419 | @@ -0,0 +1,1 @@ | |
|
420 | +a | |
|
421 | ||
|
422 | $ cd .. | |
|
423 | ||
|
424 | ||
|
425 | Issue2025: qrefresh does not honor filtering options when tip != qtip: | |
|
426 | ||
|
427 | $ hg init repo-2025 | |
|
428 | $ cd repo-2025 | |
|
429 | $ echo a > a | |
|
430 | $ echo b > b | |
|
431 | $ hg ci -qAm addab | |
|
432 | $ echo a >> a | |
|
433 | $ echo b >> b | |
|
434 | $ hg qnew -f patch | |
|
435 | $ hg up -qC 0 | |
|
436 | $ echo c > c | |
|
437 | $ hg ci -qAm addc | |
|
438 | $ hg up -qC 1 | |
|
439 | ||
|
440 | refresh with tip != qtip: | |
|
441 | ||
|
442 | $ hg --config diff.nodates=1 qrefresh -I b | |
|
443 | ||
|
444 | $ hg st | |
|
445 | M a | |
|
446 | ||
|
447 | $ cat b | |
|
448 | b | |
|
449 | b | |
|
450 | ||
|
451 | $ cat .hg/patches/patch | |
|
452 | # HG changeset patch | |
|
453 | # Parent 1a60229be7ac3e4a7f647508e99b87bef1f03593 | |
|
454 | ||
|
455 | diff -r 1a60229be7ac b | |
|
456 | --- a/b | |
|
457 | +++ b/b | |
|
458 | @@ -1,1 +1,2 @@ | |
|
459 | b | |
|
460 | +b | |
|
461 | ||
|
462 | $ cd .. | |
|
463 | ||
|
464 | ||
|
465 | Issue1441 with git patches: | |
|
466 | ||
|
467 | $ hg init repo-1441-git | |
|
468 | $ cd repo-1441-git | |
|
469 | ||
|
470 | $ echo "[diff]" >> .hg/hgrc | |
|
471 | $ echo "git=True" >> .hg/hgrc | |
|
472 | ||
|
473 | $ echo a > a | |
|
474 | $ hg add a | |
|
475 | $ hg qnew -f p | |
|
476 | $ hg mv a b | |
|
477 | $ hg qrefresh | |
|
478 | ||
|
479 | $ hg qdiff --nodates | |
|
480 | diff --git a/b b/b | |
|
481 | new file mode 100644 | |
|
482 | --- /dev/null | |
|
483 | +++ b/b | |
|
484 | @@ -0,0 +1,1 @@ | |
|
485 | +a | |
|
486 | ||
|
487 | $ cd .. | |
|
488 |
@@ -1,39 +1,62 b'' | |||
|
1 | #!/bin/sh | |
|
1 | ||
|
2 | $ echo "[extensions]" >> $HGRCPATH | |
|
3 | $ echo "mq=" >> $HGRCPATH | |
|
2 | 4 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
5 | $ hg init a | |
|
6 | $ cd a | |
|
7 | ||
|
8 | $ echo 'base' > base | |
|
9 | $ hg ci -Ambase | |
|
10 | adding base | |
|
11 | ||
|
12 | $ hg qnew -mmqbase mqbase | |
|
5 | 13 | |
|
6 | hg init a | |
|
7 | cd a | |
|
14 | $ hg qrename mqbase renamed | |
|
15 | $ mkdir .hg/patches/foo | |
|
16 | $ hg qrename renamed foo | |
|
17 | ||
|
18 | $ hg qseries | |
|
19 | foo/renamed | |
|
8 | 20 | |
|
9 | echo 'base' > base | |
|
10 | hg ci -Ambase -d '1 0' | |
|
21 | $ ls .hg/patches/foo | |
|
22 | renamed | |
|
23 | ||
|
24 | $ mkdir .hg/patches/bar | |
|
25 | $ hg qrename foo/renamed bar | |
|
26 | ||
|
27 | $ hg qseries | |
|
28 | bar/renamed | |
|
11 | 29 | |
|
12 | hg qnew -mmqbase mqbase | |
|
13 | hg qrename mqbase renamed | |
|
14 | mkdir .hg/patches/foo | |
|
15 |
hg qrename renamed |
|
|
16 | hg qseries | |
|
17 | ls .hg/patches/foo | |
|
18 | mkdir .hg/patches/bar | |
|
19 | hg qrename foo/renamed bar | |
|
20 | hg qseries | |
|
21 |
|
|
|
22 | hg qrename bar/renamed baz | |
|
23 | hg qseries | |
|
24 | ls .hg/patches/baz | |
|
25 | hg qrename baz new/dir | |
|
26 | hg qseries | |
|
27 | ls .hg/patches/new/dir | |
|
28 | cd .. | |
|
30 | $ ls .hg/patches/bar | |
|
31 | renamed | |
|
32 | ||
|
33 | $ hg qrename bar/renamed baz | |
|
34 | ||
|
35 | $ hg qseries | |
|
36 | baz | |
|
37 | ||
|
38 | $ ls .hg/patches/baz | |
|
39 | .hg/patches/baz | |
|
40 | ||
|
41 | $ hg qrename baz new/dir | |
|
42 | ||
|
43 | $ hg qseries | |
|
44 | new/dir | |
|
29 | 45 | |
|
30 | echo % test patch being renamed before committed | |
|
31 | hg init b | |
|
32 | cd b | |
|
33 | hg qinit -c | |
|
34 | hg qnew x | |
|
35 | hg qrename y | |
|
36 | hg qcommit -m rename | |
|
37 | cd .. | |
|
46 | $ ls .hg/patches/new/dir | |
|
47 | .hg/patches/new/dir | |
|
48 | ||
|
49 | $ cd .. | |
|
50 | ||
|
51 | Test patch being renamed before committed: | |
|
52 | ||
|
53 | $ hg init b | |
|
54 | $ cd b | |
|
55 | $ hg qinit -c | |
|
56 | $ hg qnew x | |
|
57 | $ hg qrename y | |
|
58 | $ hg qcommit -m rename | |
|
59 | ||
|
60 | $ cd .. | |
|
38 | 61 | |
|
39 | 62 |
@@ -1,15 +1,15 b'' | |||
|
1 | #!/bin/sh | |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "mq=" >> $HGRCPATH | |
|
2 | 3 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "mq=" >> $HGRCPATH | |
|
5 | ||
|
6 | hg init a | |
|
7 | cd a | |
|
4 | $ hg init | |
|
8 | 5 | |
|
9 | echo 'base' > base | |
|
10 |
hg ci -Ambase |
|
|
6 | $ echo 'base' > base | |
|
7 | $ hg ci -Ambase | |
|
8 | adding base | |
|
11 | 9 | |
|
12 | hg qnew -mmqbase mqbase | |
|
10 | $ hg qnew -mmqbase mqbase | |
|
13 | 11 | |
|
14 | hg qsave | |
|
15 | hg qrestore 2 | |
|
12 | $ hg qsave | |
|
13 | $ hg qrestore 2 | |
|
14 | restoring status: hg patches saved state | |
|
15 |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now