Show More
@@ -1,79 +1,210 b'' | |||||
1 | #!/bin/sh |
|
|||
2 |
|
||||
3 | # Test the plumbing of mq.git option |
|
1 | # Test the plumbing of mq.git option | |
4 | # Automatic upgrade itself is tested elsewhere. |
|
2 | # Automatic upgrade itself is tested elsewhere. | |
5 |
|
3 | |||
6 | echo "[extensions]" >> $HGRCPATH |
|
4 | $ echo "[extensions]" >> $HGRCPATH | |
7 | echo "mq=" >> $HGRCPATH |
|
5 | $ echo "mq=" >> $HGRCPATH | |
8 | echo "[diff]" >> $HGRCPATH |
|
6 | $ echo "[diff]" >> $HGRCPATH | |
9 | echo "nodates=1" >> $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 |
|
49 | $ cat .hg/patches/git | |
12 | cd repo-auto |
|
50 | # HG changeset patch | |
13 | echo '% git=auto: regular patch creation' |
|
51 | # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d | |
14 | echo a > a |
|
52 | # Date 0 0 | |
15 | hg add a |
|
53 | ||
16 | hg qnew -d '0 0' -f adda |
|
54 | diff --git a/regular b/regular | |
17 | cat .hg/patches/adda |
|
55 | new file mode 100644 | |
18 | echo '% git=auto: git patch creation with copy' |
|
56 | --- /dev/null | |
19 | hg cp a b |
|
57 | +++ b/regular | |
20 | hg qnew -d '0 0' -f copy |
|
58 | @@ -0,0 +1,1 @@ | |
21 | cat .hg/patches/copy |
|
59 | +regular | |
22 | echo '% git=auto: git patch when using --git' |
|
60 | ||
23 | echo regular > regular |
|
61 | git=auto: regular patch after qrefresh without --git: | |
24 | hg add regular |
|
62 | ||
25 | hg qnew -d '0 0' --git -f git |
|
63 | $ hg qrefresh -d '0 0' | |
26 | cat .hg/patches/git |
|
64 | ||
27 | echo '% git=auto: regular patch after qrefresh without --git' |
|
65 | $ cat .hg/patches/git | |
28 | hg qrefresh -d '0 0' |
|
66 | # HG changeset patch | |
29 | cat .hg/patches/git |
|
67 | # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d | |
30 | cd .. |
|
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 |
|
106 | $ cat .hg/patches/git | |
33 | cd repo-keep |
|
107 | # HG changeset patch | |
34 | echo '[mq]' > .hg/hgrc |
|
108 | # Parent 0000000000000000000000000000000000000000 | |
35 | echo 'git = KEEP' >> .hg/hgrc |
|
109 | # Date 0 0 | |
36 | echo '% git=keep: git patch with --git' |
|
110 | ||
37 | echo a > a |
|
111 | diff --git a/a b/a | |
38 | hg add a |
|
112 | new file mode 100644 | |
39 | hg qnew -d '0 0' -f --git git |
|
113 | --- /dev/null | |
40 | cat .hg/patches/git |
|
114 | +++ b/a | |
41 | echo '% git=keep: git patch after qrefresh without --git' |
|
115 | @@ -0,0 +1,2 @@ | |
42 | echo a >> a |
|
116 | +a | |
43 | hg qrefresh -d '0 0' |
|
117 | +a | |
44 | cat .hg/patches/git |
|
118 | $ cd .. | |
45 | 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 |
|
148 | $ cat .hg/patches/git | |
48 | cd repo-yes |
|
149 | # HG changeset patch | |
49 | echo '[mq]' > .hg/hgrc |
|
150 | # Parent 0000000000000000000000000000000000000000 | |
50 | echo 'git = yes' >> .hg/hgrc |
|
151 | # Date 0 0 | |
51 | echo '% git=yes: git patch' |
|
152 | ||
52 | echo a > a |
|
153 | diff --git a/a b/a | |
53 | hg add a |
|
154 | new file mode 100644 | |
54 | hg qnew -d '0 0' -f git |
|
155 | --- /dev/null | |
55 | cat .hg/patches/git |
|
156 | +++ b/a | |
56 | echo '% git=yes: git patch after qrefresh' |
|
157 | @@ -0,0 +1,2 @@ | |
57 | echo a >> a |
|
158 | +a | |
58 | hg qrefresh -d '0 0' |
|
159 | +a | |
59 | cat .hg/patches/git |
|
160 | $ cd .. | |
60 | 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 |
|
177 | $ cat .hg/patches/regular | |
63 | cd repo-no |
|
178 | # HG changeset patch | |
64 | echo '[diff]' > .hg/hgrc |
|
179 | # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4 | |
65 | echo 'git = True' >> .hg/hgrc |
|
180 | # Date 0 0 | |
66 | echo '[mq]' > .hg/hgrc |
|
181 | ||
67 | echo 'git = False' >> .hg/hgrc |
|
182 | diff -r ef8dafc9fa4c -r a70404f79ba3 b | |
68 | echo '% git=no: regular patch with copy' |
|
183 | --- /dev/null | |
69 | echo a > a |
|
184 | +++ b/b | |
70 | hg add a |
|
185 | @@ -0,0 +1,1 @@ | |
71 | hg qnew -d '0 0' -f adda |
|
186 | +a | |
72 | hg cp a b |
|
187 | ||
73 | hg qnew -d '0 0' -f regular |
|
188 | git=no: regular patch after qrefresh with copy: | |
74 | cat .hg/patches/regular |
|
189 | ||
75 | echo '% git=no: regular patch after qrefresh with copy' |
|
190 | $ hg cp a c | |
76 | hg cp a c |
|
191 | $ hg qrefresh -d '0 0' | |
77 | hg qrefresh -d '0 0' |
|
192 | ||
78 | cat .hg/patches/regular |
|
193 | $ cat .hg/patches/regular | |
79 | cd .. |
|
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 | # Test issue 529 - mq aborts when merging patch deleting files |
|
1 | # Test issue 529 - mq aborts when merging patch deleting files | |
4 |
|
2 | |||
5 | checkundo() |
|
3 | $ checkundo() | |
6 | { |
|
4 | > { | |
7 | if [ -f .hg/store/undo ]; then |
|
5 | > if [ -f .hg/store/undo ]; then | |
8 |
|
|
6 | > echo ".hg/store/undo still exists" | |
9 | fi |
|
7 | > fi | |
10 | } |
|
8 | > } | |
11 |
|
9 | |||
12 | echo "[extensions]" >> $HGRCPATH |
|
10 | $ echo "[extensions]" >> $HGRCPATH | |
13 | echo "mq =" >> $HGRCPATH |
|
11 | $ echo "mq =" >> $HGRCPATH | |
14 | echo "[mq]" >> $HGRCPATH |
|
12 | $ echo "[mq]" >> $HGRCPATH | |
15 | echo "git = keep" >> $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 |
|
17 | $ hg init t | |
18 | hg init t |
|
18 | $ cd t | |
19 | cd t |
|
19 | $ echo a > a | |
20 |
|
|
20 | $ echo b > b | |
21 | echo b > b |
|
21 | $ hg ci -Am init | |
22 | hg ci -Am init |
|
22 | adding a | |
23 | hg tag -l init |
|
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 |
|
32 | Save the patch queue so we can merge it later: | |
26 | hg qnew rm_a |
|
33 | ||
27 | hg rm a |
|
34 | $ hg qsave -c -e | |
28 | hg qrefresh -m "rm a" |
|
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 |
|
40 | $ hg up -C init | |
31 | hg qsave -c -e 2>&1 | grep -v '^copy' |
|
41 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
32 | checkundo qsave |
|
42 | $ echo b >> b | |
33 |
|
43 | $ hg st | ||
34 | # Update b and commit in an "update" changeset |
|
44 | M b | |
35 | hg up -C init |
|
45 | $ hg ci -m update | |
36 | echo b >> b |
|
46 | created new head | |
37 | hg st |
|
|||
38 | hg ci -m update |
|
|||
39 |
|
47 | |||
40 | # Here, qpush used to abort with : |
|
48 | # Here, qpush used to abort with : | |
41 | # The system cannot find the file specified => a |
|
49 | # The system cannot find the file specified => a | |
42 | hg manifest |
|
50 | $ hg manifest | |
43 | hg qpush -a -m 2>&1 | grep -v '^merging' |
|
51 | a | |
44 | checkundo 'qpush -m' |
|
52 | b | |
45 | hg manifest |
|
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 |
|
74 | $ hg init t2 | |
48 | hg qpop -a |
|
75 | $ cd t2 | |
49 | cd .. |
|
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* |
|
100 | $ HGMERGE=internal:other hg qpush -a -m -n refqueue | |
52 | echo |
|
101 | merging with queue at: .*/t2/.hg/refqueue | |
53 | echo % init t2 |
|
102 | applying patcha | |
54 | hg init t2 |
|
103 | patching file a | |
55 | cd t2 |
|
104 | Hunk #1 FAILED at 0 | |
56 | echo '[diff]' > .hg/hgrc |
|
105 | 1 out of 1 hunks FAILED -- saving rejects to file a.rej | |
57 | echo 'nodates = 1' >> .hg/hgrc |
|
106 | patch failed, unable to continue (try -v) | |
58 | echo a > a |
|
107 | patch failed, rejects left in working dir | |
59 | hg ci -Am init |
|
108 | patch didn't work out, merging patcha | |
60 | echo b > a |
|
109 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
61 | hg ci -m changea |
|
110 | 0 files updated, 2 files merged, 0 files removed, 0 files unresolved | |
62 | hg up -C 0 |
|
111 | (branch merge, don't forget to commit) | |
63 | hg cp a aa |
|
112 | applying patcha2 | |
64 | echo c >> a |
|
113 | now at: patcha2 | |
65 | hg qnew --git -f -e patcha |
|
114 | ||
66 | echo d >> a |
|
115 | Check patcha is still a git patch: | |
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 .. |
|
|||
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 | # Test issue835: |
|
2 | # Test issue835: | |
4 | # qpush fails immediately when patching a missing file, but |
|
3 | # qpush fails immediately when patching a missing file, but | |
5 | # remaining added files are still created empty which will |
|
4 | # remaining added files are still created empty which will | |
6 | # trick a future qrefresh. |
|
5 | # trick a future qrefresh. | |
7 |
|
6 | |||
8 | cat > writelines.py <<EOF |
|
7 | $ cat > writelines.py <<EOF | |
9 | import sys |
|
8 | > import sys | |
10 | path = sys.argv[1] |
|
9 | > path = sys.argv[1] | |
11 | args = sys.argv[2:] |
|
10 | > args = sys.argv[2:] | |
12 | assert (len(args) % 2) == 0 |
|
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') |
|
25 | $ hg init normal | |
15 | for i in xrange(len(args)/2): |
|
26 | $ cd normal | |
16 | count, s = args[2*i:2*i+2] |
|
27 | $ python ../writelines.py b 10 'a\n' | |
17 | count = int(count) |
|
28 | $ hg ci -Am addb | |
18 | s = s.decode('string_escape') |
|
29 | adding b | |
19 | f.write(s*count) |
|
30 | $ echo a > a | |
20 | f.close() |
|
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 |
|
41 | Push patch with missing target: | |
23 |
|
||||
24 | echo "[extensions]" >> $HGRCPATH |
|
|||
25 | echo "mq=" >> $HGRCPATH |
|
|||
26 |
|
42 | |||
27 | hg init normal |
|
43 | $ hg qpush | |
28 | cd normal |
|
44 | applying changeb | |
29 | python ../writelines.py b 10 'a\n' |
|
45 | unable to find 'b' for patching | |
30 | hg ci -Am addb |
|
46 | 2 out of 2 hunks FAILED -- saving rejects to file b.rej | |
31 | echo a > a |
|
47 | patch failed, unable to continue (try -v) | |
32 | python ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n' |
|
48 | patch failed, rejects left in working dir | |
33 | echo c > c |
|
49 | errors during apply, please fix and refresh changeb | |
34 | hg add a c |
|
50 | [2] | |
35 | hg qnew -f changeb |
|
51 | ||
36 | hg qpop |
|
52 | Display added files: | |
37 | hg rm b |
|
53 | ||
38 | hg ci -Am rmb |
|
54 | $ cat a | |
39 | echo % push patch with missing target |
|
55 | a | |
40 | hg qpush |
|
56 | $ cat c | |
41 | echo % display added files |
|
57 | c | |
42 | cat a |
|
58 | ||
43 | cat c |
|
59 | Display rejections: | |
44 | echo % display rejections |
|
60 | ||
45 | cat b.rej |
|
61 | $ cat b.rej | |
46 | cd .. |
|
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 |
|
80 | $ echo "[diff]" >> $HGRCPATH | |
50 | echo "git=1" >> $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 |
|
115 | $ cat a | |
53 | cd git |
|
116 | a | |
54 | python ../writelines.py b 1 '\x00' |
|
117 | $ cat c | |
55 | hg ci -Am addb |
|
118 | c | |
56 | echo a > a |
|
119 | ||
57 | python ../writelines.py b 1 '\x01' 1 '\x00' |
|
120 | Display rejections: | |
58 | echo c > c |
|
121 | ||
59 | hg add a c |
|
122 | $ cat b.rej | |
60 | hg qnew -f changeb |
|
123 | --- b | |
61 | hg qpop |
|
124 | +++ b | |
62 | hg rm b |
|
125 | GIT binary patch | |
63 | hg ci -Am rmb |
|
126 | literal 2 | |
64 | echo % push git patch with missing target |
|
127 | Jc${No0000400IC2 | |
65 | hg qpush 2>&1 | sed -e 's/b:.*/b: No such file or directory/' |
|
128 | ||
66 | hg st |
|
129 | $ cd .. | |
67 | echo % display added files |
|
130 | ||
68 | cat a |
|
131 | Test push creating directory during git copy or rename: | |
69 | cat c |
|
|||
70 | echo % display rejections |
|
|||
71 | cat b.rej |
|
|||
72 | cd .. |
|
|||
73 |
|
132 | |||
74 | echo % test push creating directory during git copy or rename |
|
133 | $ hg init missingdir | |
75 |
|
|
134 | $ cd missingdir | |
76 | cd missingdir |
|
135 | $ echo a > a | |
77 | echo a > a |
|
136 | $ hg ci -Am adda | |
78 | hg ci -Am adda |
|
137 | adding a | |
79 | mkdir d |
|
138 | $ mkdir d | |
80 | hg copy a d/a2 |
|
139 | $ hg copy a d/a2 | |
81 | hg mv a d/a |
|
140 | $ hg mv a d/a | |
82 | hg qnew -g -f patch |
|
141 | $ hg qnew -g -f patch | |
83 | hg qpop |
|
142 | $ hg qpop | |
84 | hg qpush |
|
143 | popping patch | |
85 | cd .. |
|
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 |
|
12 | $ hg init base | |
4 | [extensions] |
|
13 | $ cd base | |
5 | mq= |
|
14 | $ echo "One" > one | |
6 | [defaults] |
|
15 | $ hg add | |
7 | log = --template "{rev}: {desc}\\n" |
|
16 | adding one | |
8 | heads = --template "{rev}: {desc}\\n" |
|
17 | $ hg ci -m "main: one added" | |
9 | incoming = --template "{rev}: {desc}\\n" |
|
18 | $ echo "++" >> one | |
10 | EOF |
|
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" |
|
32 | $ hg -R fresh tincoming main.hg | |
13 | hg init base |
|
33 | comparing with main.hg | |
14 | cd base |
|
34 | 0: main: one added | |
15 | echo "One" > one |
|
35 | 1: main: one updated | |
16 | hg add |
|
36 | ||
17 | hg ci -m "main: one added." |
|
37 | $ hg -R fresh tincoming bundle:fresh+main.hg | |
18 | echo "++" >> one |
|
38 | comparing with bundle:fresh+main.hg | |
19 |
|
|
39 | 0: main: one added | |
|
40 | 1: main: one updated | |||
|
41 | ||||
|
42 | ||||
|
43 | Setup queue: | |||
20 |
|
44 | |||
21 | echo "====== Bundle main" |
|
45 | $ cd base | |
22 | hg bundle --base=null ../main.hg |
|
46 | $ hg qinit -c | |
23 | cd .. |
|
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" |
|
57 | Bundle queue: | |
26 | hg init fresh |
|
58 | ||
27 | echo ">> hg -R fresh incoming main.hg" |
|
59 | $ hg -R .hg/patches bundle --base=null ../queue.hgq | |
28 | hg -R fresh incoming main.hg |
|
60 | 1 changesets found | |
29 | echo ">> hg -R fresh incoming bundle:fresh+main.hg" |
|
61 | ||
30 | hg -R fresh incoming bundle:fresh+main.hg |
|
62 | $ cd .. | |
31 |
|
63 | |||
32 |
|
64 | |||
33 | echo "====== Setup queue" |
|
65 | Clone base: | |
34 | cd base |
|
66 | ||
35 | hg qinit -c |
|
67 | $ hg clone base copy | |
36 | hg qnew -m "patch: two added." two.patch |
|
68 | updating to branch default | |
37 | echo two > two |
|
69 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
38 | hg add |
|
70 | $ cd copy | |
39 | hg qrefresh |
|
71 | $ hg qinit -c | |
40 | hg qcommit -m "queue: two.patch added." |
|
72 | ||
41 | hg qpop -a |
|
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" |
|
81 | $ hg -R .hg/patches pull --update ../queue.hgq | |
44 | hg -R .hg/patches bundle --base=null ../queue.hgq |
|
82 | pulling from ../queue.hgq | |
45 | cd .. |
|
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" |
|
103 | Clone base again: | |
49 | hg clone base copy |
|
|||
50 | cd copy |
|
|||
51 | hg qinit -c |
|
|||
52 |
|
104 | |||
53 | echo "====== Incoming queue bundle" |
|
105 | $ hg clone base copy2 | |
54 | echo ">> hg -R .hg/patches incoming ../queue.hgq" |
|
106 | updating to branch default | |
55 | hg -R .hg/patches incoming ../queue.hgq |
|
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" |
|
113 | $ hg -R .hg/patches unbundle --update ../queue.hgq | |
58 | echo ">> hg -R .hg/patches pull --update ../queue.hgq" |
|
114 | adding changesets | |
59 | hg -R .hg/patches pull --update ../queue.hgq |
|
115 | adding manifests | |
60 | echo ">> hg -R .hg/patches heads" |
|
116 | adding file changes | |
61 | hg -R .hg/patches heads |
|
117 | added 1 changesets with 3 changes to 3 files | |
62 | echo ">> hg -R .hg/patches log" |
|
118 | merging series | |
63 | hg -R .hg/patches log |
|
119 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
64 | echo ">> hg qseries" |
|
|||
65 | hg qseries |
|
|||
66 | cd .. |
|
|||
67 |
|
||||
68 |
|
120 | |||
69 | echo "====== Clone base again" |
|
121 | $ hg -R .hg/patches theads | |
70 | hg clone base copy2 |
|
122 | 0: queue: two.patch added | |
71 | cd copy2 |
|
123 | ||
72 | hg qinit -c |
|
124 | $ hg -R .hg/patches tlog | |
|
125 | 0: queue: two.patch added | |||
73 |
|
126 | |||
74 | echo "====== Unbundle queue bundle" |
|
127 | $ hg qseries | |
75 | echo ">> hg -R .hg/patches unbundle --update ../queue.hgq" |
|
128 | two.patch | |
76 | hg -R .hg/patches unbundle --update ../queue.hgq |
|
129 | ||
77 | echo ">> hg -R .hg/patches heads" |
|
130 | $ cd .. | |
78 | hg -R .hg/patches heads |
|
131 | ||
79 | echo ">> hg -R .hg/patches log" |
|
|||
80 | hg -R .hg/patches log |
|
|||
81 | echo ">> hg qseries" |
|
|||
82 | hg qseries |
|
|||
83 | cd .. |
|
@@ -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 |
|
7 | $ echo 'base' > base | |
4 | echo "mq=" >> $HGRCPATH |
|
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 |
|
15 | $ hg qdel | |
7 | cd a |
|
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 |
|
23 | $ hg qpop | |
10 | hg ci -Ambase -d '1 0' |
|
24 | popping c | |
|
25 | now at: b | |||
11 |
|
26 | |||
12 | hg qnew -d '1 0' a |
|
27 | $ hg qdel c | |
13 | hg qnew -d '1 0' b |
|
28 | ||
14 | hg qnew -d '1 0' c |
|
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 |
|
54 | $ hg qapplied | |
19 | hg qpop |
|
55 | ||
20 | hg qdel c |
|
56 | $ hg log --template '{rev} {desc}\n' | |
21 | hg qseries |
|
57 | 1 [mq]: a | |
22 | ls .hg/patches |
|
58 | 0 base | |
23 | hg qpop |
|
59 | ||
24 | hg qdel -k 1 |
|
60 | $ hg qnew d | |
25 | ls .hg/patches |
|
61 | $ hg qnew e | |
26 | hg qdel -r a |
|
62 | $ hg qnew f | |
27 | hg qapplied |
|
|||
28 | hg log --template '{rev} {desc}\n' |
|
|||
29 |
|
63 | |||
30 | hg qnew d |
|
64 | $ hg qdel -r e | |
31 | hg qnew e |
|
65 | abort: cannot delete revision 3 above applied patches | |
32 | hg qnew f |
|
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 |
|
75 | $ hg log --template '{rev} {desc}\n' | |
35 | hg qdel -r qbase:e |
|
76 | 4 [mq]: f | |
36 | hg qapplied |
|
77 | 3 [mq]: e | |
37 | hg log --template '{rev} {desc}\n' |
|
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 .. |
|
91 | $ hg qfinish | |
40 | hg init b |
|
92 | abort: no revisions specified | |
41 | cd b |
|
93 | [255] | |
|
94 | ||||
|
95 | $ hg qfinish -a | |||
|
96 | no patches applied | |||
42 |
|
97 | |||
43 | echo 'base' > base |
|
98 | $ hg qnew -d '1 0' a | |
44 | hg ci -Ambase -d '1 0' |
|
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 |
|
102 | $ hg qfinish 0 | |
47 | hg qfinish -a |
|
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 |
|
110 | $ hg qpop | |
50 | hg qnew -d '1 0' b |
|
111 | popping c | |
51 | hg qnew c # XXX fails to apply by /usr/bin/patch if we put a date |
|
112 | now at: b | |
|
113 | ||||
|
114 | $ hg qfinish -a c | |||
|
115 | abort: unknown revision 'c'! | |||
|
116 | [255] | |||
52 |
|
117 | |||
53 | hg qfinish 0 |
|
118 | $ hg qpush | |
54 | hg qfinish b |
|
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 |
|
130 | $ hg log --template '{rev} {desc}\n' | |
57 | hg qfinish -a c |
|
131 | 3 imported patch c | |
58 | hg qpush |
|
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 |
|
141 | $ hg log --template '{rev} {desc}\n' | |
61 | hg qapplied |
|
142 | 3 imported patch c | |
62 | hg log --template '{rev} {desc}\n' |
|
143 | 2 [mq]: b | |
|
144 | 1 [mq]: a | |||
|
145 | 0 base | |||
63 |
|
146 | |||
64 | hg qfinish -a c |
|
147 | $ ls .hg/patches | |
65 | hg qapplied |
|
148 | series | |
66 | hg log --template '{rev} {desc}\n' |
|
149 | status | |
67 | ls .hg/patches |
|
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 |
|
9 | $ echo 'base' > base | |
4 | echo "mq=" >> $HGRCPATH |
|
10 | $ hg ci -Ambase | |
5 | echo "[mq]" >> $HGRCPATH |
|
11 | adding base | |
6 | echo "git=keep" >> $HGRCPATH |
|
12 | ||
|
13 | $ hg qnew -mmqbase mqbase | |||
|
14 | ||||
|
15 | $ echo 'patched' > base | |||
|
16 | $ hg qrefresh | |||
|
17 | ||||
|
18 | qdiff: | |||
7 |
|
19 | |||
8 | echo % init |
|
20 | $ hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" | |
9 | hg init a |
|
21 | diff -r d20a80d4def3 base | |
10 | cd a |
|
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 |
|
30 | $ hg qdiff --nodates . | |
13 | echo 'base' > base |
|
31 | diff -r d20a80d4def3 base | |
14 | hg ci -Ambase -d '1 0' |
|
32 | --- a/base | |
|
33 | +++ b/base | |||
|
34 | @@ -1,1 +1,1 @@ | |||
|
35 | -base | |||
|
36 | +patched | |||
15 |
|
37 | |||
16 | echo % qnew mqbase |
|
38 | qdiff filename: | |
17 | hg qnew -mmqbase mqbase |
|
|||
18 |
|
39 | |||
19 | echo % qrefresh |
|
40 | $ hg qdiff --nodates base | |
20 | echo 'patched' > base |
|
41 | diff -r d20a80d4def3 base | |
21 | hg qrefresh |
|
42 | --- a/base | |
|
43 | +++ b/base | |||
|
44 | @@ -1,1 +1,1 @@ | |||
|
45 | -base | |||
|
46 | +patched | |||
22 |
|
47 | |||
23 | echo % qdiff |
|
48 | $ hg revert -a | |
24 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
49 | ||
25 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
50 | $ hg qpop | |
|
51 | popping mqbase | |||
|
52 | patch queue now empty | |||
|
53 | ||||
|
54 | $ hg qdelete mqbase | |||
26 |
|
55 | |||
27 | echo % qdiff dirname |
|
56 | $ printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines | |
28 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
57 | $ hg ci -Amlines -d '2 0' | |
29 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
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 |
|
63 | $ hg qdiff --nodates -U 1 | |
32 | hg qdiff --nodates base |
|
64 | diff -r b0c220e1cf43 lines | |
33 |
|
65 | --- a/lines | ||
34 | echo % revert |
|
66 | +++ b/lines | |
35 | hg revert -a |
|
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 |
|
79 | $ hg qdiff --nodates -b | |
38 | hg qpop |
|
80 | diff -r b0c220e1cf43 lines | |
39 |
|
81 | --- a/lines | ||
40 | echo % qdelete mqbase |
|
82 | +++ b/lines | |
41 | hg qdelete mqbase |
|
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 |
|
97 | $ hg qdiff --nodates -U 1 -B | |
44 | printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines |
|
98 | diff -r b0c220e1cf43 lines | |
45 | hg ci -Amlines -d '2 0' |
|
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 |
|
109 | $ hg qdiff --nodates -w | |
48 | hg qnew -mmqbase2 mqbase2 |
|
110 | diff -r b0c220e1cf43 lines | |
49 | printf '\n\n1\n2\n3\n4\nhello world\n goodbye world\n7\n8\n9\n' > lines |
|
111 | --- a/lines | |
50 |
|
112 | +++ b/lines | ||
51 | echo % qdiff -U 1 |
|
113 | @@ -1,3 +1,5 @@ | |
52 | hg qdiff --nodates -U 1 |
|
114 | + | |
|
115 | + | |||
|
116 | 1 | |||
|
117 | 2 | |||
|
118 | 3 | |||
53 |
|
119 | |||
54 | echo % qdiff -b |
|
120 | $ hg qdiff --nodates --reverse | |
55 | hg qdiff --nodates -b |
|
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 |
|
139 | qdiff preserve existing git flag: | |
58 | hg qdiff --nodates -U 1 -B |
|
|||
59 |
|
||||
60 | echo % qdiff -w |
|
|||
61 | hg qdiff --nodates -w |
|
|||
62 |
|
140 | |||
63 | echo % qdiff --reverse |
|
141 | $ hg qrefresh --git | |
64 | hg qdiff --nodates --reverse |
|
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 |
|
163 | $ hg qdiff --stat | |
67 | hg qrefresh --git |
|
164 | lines | 7 +++++-- | |
68 | echo a >> lines |
|
165 | 1 files changed, 5 insertions(+), 2 deletions(-) | |
69 | hg qdiff |
|
|||
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 |
|
10 | $ hg init repo | |
4 | echo "mq=" >> $HGRCPATH |
|
11 | $ cd repo | |
5 | echo "[mq]" >> $HGRCPATH |
|
12 | $ echo a > a | |
6 | echo "git=keep" >> $HGRCPATH |
|
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() |
|
37 | $ hg qfold p2 | |
9 | { |
|
38 | $ grep git .hg/patches/p1 && echo 'git patch found!' | |
10 | grep -v diff | \ |
|
39 | [1] | |
11 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
40 | ||
12 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
41 | $ hg qser | |
13 | } |
|
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() |
|
54 | Fold with local changes: | |
16 | { |
|
55 | ||
17 | sed -e "s/\(# Parent \).*/\1/" |
|
56 | $ echo d >> a | |
18 | } |
|
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' |
|
73 | Fold git patch into a regular patch, expect git patch: | |
21 | hg init repo |
|
74 | ||
22 | cd repo |
|
75 | $ echo a >> a | |
23 | echo a > a |
|
76 | $ hg qnew -f regular | |
24 | hg ci -Am adda |
|
77 | $ hg cp a aa | |
25 | echo a >> a |
|
78 | $ hg qnew --git -f git | |
26 | hg qnew -f p1 |
|
79 | ||
27 | echo b >> a |
|
80 | $ hg qpop | |
28 | hg qnew -f p2 |
|
81 | popping git | |
29 | echo c >> a |
|
82 | now at: regular | |
30 | hg qnew -f p3 |
|
83 | ||
31 | echo '% fold in the middle of the queue' |
|
84 | $ hg qfold git | |
32 | hg qpop p1 |
|
85 | ||
33 | hg qdiff | filterdiff |
|
86 | $ cat .hg/patches/regular | |
34 | hg qfold p2 |
|
87 | # HG changeset patch | |
35 | grep git .hg/patches/p1 && echo 'git patch found!' |
|
88 | # Parent ........................................ | |
36 | hg qser |
|
89 | ||
37 | hg qdiff | filterdiff |
|
90 | diff --git a/a b/a | |
38 | echo '% fold with local changes' |
|
91 | --- a/a | |
39 | echo d >> a |
|
92 | +++ b/a | |
40 | hg qfold p3 |
|
93 | @@ -1,3 +1,4 @@ | |
41 | hg diff -c . | filterdiff |
|
94 | a | |
42 | hg revert -a --no-backup |
|
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' |
|
109 | $ hg qpop | |
45 | echo a >> a |
|
110 | popping regular | |
46 | hg qnew -f regular |
|
111 | now at: p1 | |
47 | hg cp a aa |
|
112 | ||
48 | hg qnew --git -f git |
|
113 | $ hg qdel regular | |
49 | hg qpop |
|
114 | ||
50 | hg qfold git |
|
115 | Fold regular patch into a git patch, expect git patch: | |
51 | cat .hg/patches/regular | filterpatch |
|
116 | ||
52 | hg qpop |
|
117 | $ hg cp a aa | |
53 | hg qdel regular |
|
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' |
|
126 | $ hg qfold regular | |
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 |
|
|||
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 | $ hg init a | |
4 | echo "mq=" >> $HGRCPATH |
|
5 | $ cd a | |
|
6 | $ echo a > a | |||
|
7 | $ hg ci -Ama | |||
|
8 | adding a | |||
5 |
|
9 | |||
6 | hg init a |
|
10 | $ hg qnew a.patch | |
7 | cd a |
|
11 | $ echo a >> a | |
8 | echo a > a |
|
12 | $ hg qrefresh | |
9 | hg ci -Ama |
|
13 | ||
|
14 | $ hg qnew b.patch | |||
|
15 | $ echo b > b | |||
|
16 | $ hg add b | |||
|
17 | $ hg qrefresh | |||
10 |
|
18 | |||
11 |
hg qnew |
|
19 | $ hg qnew c.patch | |
12 |
|
|
20 | $ echo c > c | |
13 | hg qrefresh |
|
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 |
|
|
29 | $ hg qgoto c.patch | |
16 | echo b > b |
|
30 | applying b.patch | |
17 | hg add b |
|
31 | applying c.patch | |
18 | hg qrefresh |
|
32 | now at: c.patch | |
19 |
|
33 | |||
20 |
|
|
34 | $ hg qgoto b.patch | |
21 | echo c > c |
|
35 | popping c.patch | |
22 | hg add c |
|
36 | now at: b.patch | |
23 | hg qrefresh |
|
37 | ||
|
38 | Using index: | |||
24 |
|
39 | |||
25 |
hg qgoto |
|
40 | $ hg qgoto 0 | |
26 | hg qgoto c.patch |
|
41 | popping b.patch | |
27 |
|
|
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 |
|
49 | No warnings when using index: | |
30 | echo % Using index |
|
50 | ||
31 | hg qgoto 0 |
|
51 | $ hg qnew bug314159 | |
32 | hg qgoto 2 |
|
52 | $ echo d >> c | |
|
53 | $ hg qrefresh | |||
|
54 | $ hg qnew bug141421 | |||
|
55 | $ echo e >> c | |||
|
56 | $ hg qrefresh | |||
33 |
|
57 | |||
34 | echo |
|
58 | $ hg qgoto 1 | |
35 | echo % No warnings when using index |
|
59 | popping bug141421 | |
36 |
|
|
60 | popping bug314159 | |
37 | echo d >> c |
|
61 | popping c.patch | |
38 | hg qrefresh |
|
62 | now at: b.patch | |
39 | hg qnew bug141421 |
|
|||
40 | echo e >> c |
|
|||
41 | hg qrefresh |
|
|||
42 | hg qgoto 1 |
|
|||
43 | hg qgoto 3 |
|
|||
44 |
|
63 | |||
45 | echo |
|
64 | $ hg qgoto 3 | |
46 | echo % Detect ambiguous non-index |
|
65 | applying c.patch | |
47 | hg qgoto 14 |
|
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 | $ hg init foo | |
4 | echo "mq=" >> $HGRCPATH |
|
5 | $ cd foo | |
|
6 | $ echo a > a | |||
|
7 | $ hg ci -qAm a | |||
|
8 | ||||
|
9 | Default queue: | |||
5 |
|
10 | |||
6 | hg init foo |
|
11 | $ hg qqueue | |
7 | cd foo |
|
12 | patches (active) | |
8 | echo a > a |
|
13 | ||
9 | hg ci -qAm a |
|
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 |
|
24 | $ hg qqueue foo --create | |
12 | hg qqueue |
|
25 | abort: patches applied - cannot set new queue active | |
|
26 | [255] | |||
13 |
|
27 | |||
14 | echo b > a |
|
28 | $ hg qqueue | |
15 | hg qnew -fgDU somestuff |
|
29 | foo | |
|
30 | patches (active) | |||
|
31 | ||||
|
32 | Empty default queue: | |||
16 |
|
33 | |||
17 | echo %% applied patches in default queue |
|
34 | $ hg qpop | |
18 | hg qap |
|
35 | popping somestuff | |
|
36 | patch queue now empty | |||
|
37 | ||||
|
38 | Switch queue: | |||
19 |
|
39 | |||
20 | echo %% try to change patch \(create succeeds, switch fails\) |
|
40 | $ hg qqueue foo | |
21 | hg qqueue foo --create |
|
41 | $ hg qqueue | |
22 | hg qqueue |
|
42 | foo (active) | |
|
43 | patches | |||
|
44 | ||||
|
45 | List queues, quiet: | |||
23 |
|
46 | |||
24 | echo %% empty default queue |
|
47 | $ hg qqueue --quiet | |
25 | hg qpop |
|
48 | foo | |
|
49 | patches | |||
26 |
|
50 | |||
27 | echo %% switch queue |
|
51 | Fail creating queue with already existing name: | |
28 | hg qqueue foo |
|
52 | ||
29 | hg qqueue |
|
53 | $ hg qqueue --create foo | |
|
54 | abort: queue "foo" already exists | |||
|
55 | [255] | |||
30 |
|
56 | |||
31 | echo %% list queues, quiet |
|
57 | $ hg qqueue | |
32 | hg qqueue --quiet |
|
58 | foo (active) | |
|
59 | patches | |||
|
60 | ||||
|
61 | Create new queue for rename: | |||
33 |
|
62 | |||
34 | echo %% fail creating queue with already existing name |
|
63 | $ hg qqueue --create bar | |
35 | hg qqueue --create foo |
|
64 | ||
36 | hg qqueue |
|
65 | $ hg qqueue | |
|
66 | bar (active) | |||
|
67 | foo | |||
|
68 | patches | |||
37 |
|
69 | |||
38 | echo %% create new queue for rename |
|
70 | Rename queue, same name: | |
39 | hg qqueue --create bar |
|
|||
40 | hg qqueue |
|
|||
41 |
|
71 | |||
42 | echo %% rename queue, same name |
|
72 | $ hg qqueue --rename bar | |
43 | 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 |
|
78 | $ hg qqueue --rename foo | |
46 | hg qqueue --rename foo |
|
79 | abort: queue "foo" already exists | |
|
80 | [255] | |||
|
81 | ||||
|
82 | Rename queue: | |||
47 |
|
83 | |||
48 | echo %% rename queue |
|
84 | $ hg qqueue --rename buz | |
49 | hg qqueue --rename buz |
|
85 | ||
50 | hg qqueue |
|
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 |
|
93 | $ hg qqueue foo | |
53 | hg qqueue foo |
|
94 | $ hg qqueue --delete buz | |
54 | hg qqueue --delete buz |
|
95 | ||
55 | hg qqueue |
|
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 |
|
104 | $ hg qqueue | |
58 | hg qqueue --create purge-me |
|
105 | foo | |
59 | hg qqueue |
|
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 |
|
116 | $ hg qpop -a | |
62 |
|
|
117 | popping patch-purge-me | |
63 | ls -1d .hg/patches-purge-me 2>/dev/null || true |
|
118 | patch queue now empty | |
64 | hg qpop -a |
|
119 | ||
|
120 | Purge queue: | |||
|
121 | ||||
|
122 | $ hg qqueue foo | |||
|
123 | $ hg qqueue --purge purge-me | |||
65 |
|
124 | |||
66 | echo %% purge queue |
|
125 | $ hg qqueue | |
67 | hg qqueue foo |
|
126 | foo (active) | |
68 | hg qqueue --purge purge-me |
|
127 | patches | |
69 | hg qqueue |
|
128 | ||
70 | ls -1d .hg/patches-purge-me 2>/dev/null || true |
|
129 | $ ls -1d .hg/patches-purge-me 2>/dev/null || true | |
71 |
|
130 | |||
72 |
|
|
131 | Unapplied patches: | |
73 | hg qun |
|
132 | ||
74 | echo c > a |
|
133 | $ hg qun | |
75 | hg qnew -fgDU otherstuff |
|
134 | $ echo c > a | |
|
135 | $ hg qnew -fgDU otherstuff | |||
|
136 | ||||
|
137 | Fail switching back: | |||
76 |
|
138 | |||
77 | echo %% fail switching back |
|
139 | $ hg qqueue patches | |
78 | hg qqueue patches |
|
140 | abort: patches applied - cannot set new queue active | |
|
141 | [255] | |||
79 |
|
142 | |||
80 |
|
|
143 | Fail deleting current: | |
81 | hg qqueue foo --delete |
|
144 | ||
|
145 | $ hg qqueue foo --delete | |||
|
146 | abort: cannot delete currently active queue | |||
|
147 | [255] | |||
82 |
|
148 | |||
83 |
|
|
149 | Switch back and delete foo: | |
84 | hg qpop -a |
|
150 | ||
85 | hg qqueue patches |
|
151 | $ hg qpop -a | |
86 | hg qqueue foo --delete |
|
152 | popping otherstuff | |
87 | hg qqueue |
|
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 |
|
162 | $ hg qqueue store --create | |
90 | hg qqueue store --create |
|
163 | $ hg qnew journal | |
91 | hg qnew journal |
|
164 | ||
92 | hg qqueue |
|
165 | $ hg qqueue | |
93 | hg qpop -a |
|
166 | patches | |
94 | hg qqueue patches |
|
167 | store (active) | |
95 | hg qun |
|
168 | ||
|
169 | $ hg qpop -a | |||
|
170 | popping journal | |||
|
171 | patch queue now empty | |||
96 |
|
172 | |||
97 | echo %% invalid names |
|
173 | $ hg qqueue patches | |
98 | hg qqueue test/../../bar --create |
|
174 | $ hg qun | |
99 | hg qqueue . --create |
|
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 |
|
6 | $ hg init a | |
4 | echo "mq=" >> $HGRCPATH |
|
7 | $ cd a | |
5 |
|
||||
6 | catpatch() { |
|
|||
7 | cat $1 | sed -e "s/^\(# Parent \).*/\1/" |
|
|||
8 | } |
|
|||
9 |
|
8 | |||
10 | echo % init |
|
9 | $ mkdir 1 2 | |
11 | hg init a |
|
10 | $ echo 'base' > 1/base | |
12 | cd a |
|
11 | $ echo 'base' > 2/base | |
|
12 | $ hg ci -Ambase | |||
|
13 | adding 1/base | |||
|
14 | adding 2/base | |||
13 |
|
15 | |||
14 | echo % commit |
|
16 | $ hg qnew -mmqbase mqbase | |
15 | mkdir 1 2 |
|
|||
16 | echo 'base' > 1/base |
|
|||
17 | echo 'base' > 2/base |
|
|||
18 | hg ci -Ambase -d '1 0' |
|
|||
19 |
|
17 | |||
20 | echo % qnew mqbase |
|
18 | $ echo 'patched' > 1/base | |
21 | hg qnew -mmqbase mqbase |
|
19 | $ echo 'patched' > 2/base | |
|
20 | $ hg qrefresh | |||
22 |
|
21 | |||
23 | echo % qrefresh |
|
22 | $ hg qdiff | |
24 | echo 'patched' > 1/base |
|
23 | diff -r e7af5904b465 1/base | |
25 | echo 'patched' > 2/base |
|
24 | --- a/1/base | |
26 | hg qrefresh |
|
25 | +++ b/1/base | |
27 |
|
26 | @@ -1,1 +1,1 @@ | ||
28 | echo % qdiff |
|
27 | -base | |
29 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
28 | +patched | |
30 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
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 |
|
36 | $ hg qdiff . | |
33 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
37 | diff -r e7af5904b465 1/base | |
34 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
38 | --- a/1/base | |
35 |
|
39 | +++ b/1/base | ||
36 | echo % patch file contents |
|
40 | @@ -1,1 +1,1 @@ | |
37 | catpatch .hg/patches/mqbase | \ |
|
41 | -base | |
38 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
42 | +patched | |
39 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
43 | diff -r e7af5904b465 2/base | |
40 |
|
44 | --- a/2/base | ||
41 | echo % qrefresh 1 |
|
45 | +++ b/2/base | |
42 | echo 'patched again' > base |
|
46 | @@ -1,1 +1,1 @@ | |
43 | hg qrefresh 1 |
|
47 | -base | |
|
48 | +patched | |||
44 |
|
49 | |||
45 | echo % qdiff |
|
50 | $ cat .hg/patches/mqbase | |
46 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
51 | # HG changeset patch | |
47 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
52 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
48 |
|
53 | mqbase | ||
49 | echo % qdiff dirname |
|
54 | ||
50 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
55 | diff -r e7af5904b465 1/base | |
51 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
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 |
|
68 | $ echo 'patched again' > base | |
54 | catpatch .hg/patches/mqbase | \ |
|
69 | $ hg qrefresh 1 | |
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/" |
|
|||
64 |
|
70 | |||
65 | echo % qdiff dirname |
|
71 | $ hg qdiff | |
66 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
72 | diff -r e7af5904b465 1/base | |
67 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
73 | --- a/1/base | |
68 |
|
74 | +++ b/1/base | ||
69 | echo % patch file contents |
|
75 | @@ -1,1 +1,1 @@ | |
70 | catpatch .hg/patches/mqbase | \ |
|
76 | -base | |
71 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
77 | +patched | |
72 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
78 | diff -r e7af5904b465 2/base | |
73 |
|
79 | --- a/2/base | ||
74 | echo % qrefresh in hg-root again |
|
80 | +++ b/2/base | |
75 | hg qrefresh |
|
81 | @@ -1,1 +1,1 @@ | |
|
82 | -base | |||
|
83 | +patched | |||
76 |
|
84 | |||
77 | echo % qdiff |
|
85 | $ hg qdiff . | |
78 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
86 | diff -r e7af5904b465 1/base | |
79 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
87 | --- a/1/base | |
80 |
|
88 | +++ b/1/base | ||
81 | echo % qdiff dirname |
|
89 | @@ -1,1 +1,1 @@ | |
82 | hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
90 | -base | |
83 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
91 | +patched | |
84 |
|
92 | diff -r e7af5904b465 2/base | ||
85 | echo % patch file contents |
|
93 | --- a/2/base | |
86 | catpatch .hg/patches/mqbase | \ |
|
94 | +++ b/2/base | |
87 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
95 | @@ -1,1 +1,1 @@ | |
88 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
96 | -base | |
|
97 | +patched | |||
89 |
|
98 | |||
90 | echo |
|
99 | $ cat .hg/patches/mqbase | |
91 | echo % qrefresh --short tests: |
|
100 | # HG changeset patch | |
92 | echo 'orphan' > orphanchild |
|
101 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
93 | hg add orphanchild |
|
102 | mqbase | |
94 |
|
103 | |||
95 | echo % - add 1/base and 2/base one by one |
|
104 | diff -r e7af5904b465 1/base | |
96 | hg qrefresh nonexistingfilename # clear patch |
|
105 | --- a/1/base | |
97 | hg qrefresh --short 1/base |
|
106 | +++ b/1/base | |
98 | hg qrefresh --short 2/base |
|
107 | @@ -1,1 +1,1 @@ | |
|
108 | -base | |||
|
109 | +patched | |||
99 |
|
110 | |||
100 | echo % -- qdiff output |
|
111 | qrefresh . in subdir: | |
101 | hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
|||
102 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
|||
103 |
|
112 | |||
104 | echo % -- patch file content |
|
113 | $ ( cd 1 ; hg qrefresh . ) | |
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 |
|
|||
109 |
|
114 | |||
110 | echo % -- diff shows what is not in patch |
|
115 | $ hg qdiff | |
111 | hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
116 | diff -r e7af5904b465 1/base | |
112 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
117 | --- a/1/base | |
113 | -e "s/^\(diff\).*/\1/" |
|
118 | +++ b/1/base | |
114 | echo % - before starting exclusive tests |
|
119 | @@ -1,1 +1,1 @@ | |
115 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase |
|
120 | -base | |
116 | echo % - exclude 2/base |
|
121 | +patched | |
117 | hg qref -s -X 2/base |
|
122 | diff -r e7af5904b465 2/base | |
118 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase |
|
123 | --- a/2/base | |
119 | echo % -- status shows 2/base as dirty |
|
124 | +++ b/2/base | |
120 | hg st |
|
125 | @@ -1,1 +1,1 @@ | |
121 | echo % - remove 1/base and add 2/base again but not orphanchild |
|
126 | -base | |
122 | hg qref -s -X orphanchild -X 1/base 2/base orphanchild |
|
127 | +patched | |
123 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase |
|
128 | ||
124 | echo % - add 1/base with include filter - and thus remove 2/base from patch |
|
129 | $ hg qdiff . | |
125 | hg qref -s -I 1/ o* */* |
|
130 | diff -r e7af5904b465 1/base | |
126 | sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase |
|
131 | --- a/1/base | |
127 | echo |
|
132 | +++ b/1/base | |
128 | cd .. |
|
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 |
|
143 | $ cat .hg/patches/mqbase | |
131 | echo % create test repo |
|
144 | # HG changeset patch | |
132 | hg init repo |
|
145 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
133 | cd repo |
|
146 | mqbase | |
134 | echo "[diff]" >> .hg/hgrc |
|
147 | ||
135 | echo "git=True" >> .hg/hgrc |
|
148 | diff -r e7af5904b465 1/base | |
136 | echo a > a |
|
149 | --- a/1/base | |
137 | hg ci -Am adda |
|
150 | +++ b/1/base | |
138 | hg copy a ab |
|
151 | @@ -1,1 +1,1 @@ | |
139 | echo b >> ab |
|
152 | -base | |
140 | hg copy a ac |
|
153 | +patched | |
141 | echo c >> ac |
|
154 | ||
142 | echo % capture changes |
|
155 | qrefresh in hg-root again: | |
143 | hg qnew -f p1 |
|
156 | ||
144 | hg qdiff |
|
157 | $ hg qrefresh | |
145 | echo % refresh and check changes again |
|
158 | ||
146 | hg qref |
|
159 | $ hg qdiff | |
147 | hg qdiff |
|
160 | diff -r e7af5904b465 1/base | |
148 | cd .. |
|
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 |
|
173 | $ hg qdiff . | |
151 | echo % issue1441 without git patches |
|
174 | diff -r e7af5904b465 1/base | |
152 | hg init repo-1441 |
|
175 | --- a/1/base | |
153 | cd repo-1441 |
|
176 | +++ b/1/base | |
154 | echo a > a |
|
177 | @@ -1,1 +1,1 @@ | |
155 | hg add a |
|
178 | -base | |
156 | hg qnew -f p |
|
179 | +patched | |
157 | hg mv a b |
|
180 | diff -r e7af5904b465 2/base | |
158 | hg qrefresh |
|
181 | --- a/2/base | |
159 | hg qdiff --nodates |
|
182 | +++ b/2/base | |
160 | cd .. |
|
183 | @@ -1,1 +1,1 @@ | |
|
184 | -base | |||
|
185 | +patched | |||
161 |
|
186 | |||
162 | echo '% issue2025: qrefresh does not honor filtering options when tip != qtip' |
|
187 | $ cat .hg/patches/mqbase | |
163 | hg init repo-2025 |
|
188 | # HG changeset patch | |
164 | cd repo-2025 |
|
189 | # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa | |
165 | echo a > a |
|
190 | mqbase | |
166 | echo b > b |
|
191 | ||
167 | hg ci -qAm addab |
|
192 | diff -r e7af5904b465 1/base | |
168 | echo a >> a |
|
193 | --- a/1/base | |
169 | echo b >> b |
|
194 | +++ b/1/base | |
170 | hg qnew -f patch |
|
195 | @@ -1,1 +1,1 @@ | |
171 | hg up -qC 0 |
|
196 | -base | |
172 | echo c > c |
|
197 | +patched | |
173 | hg ci -qAm addc |
|
198 | diff -r e7af5904b465 2/base | |
174 | hg up -qC 1 |
|
199 | --- a/2/base | |
175 | echo '% refresh with tip != qtip' |
|
200 | +++ b/2/base | |
176 | hg --config diff.nodates=1 qrefresh -I b 2>&1 \ |
|
201 | @@ -1,1 +1,1 @@ | |
177 | | sed 's/saving bundle.*/saving bundle.../g' |
|
202 | -base | |
178 | echo '% status after refresh' |
|
203 | +patched | |
179 | hg st |
|
|||
180 | echo '% b after refresh' |
|
|||
181 | cat b |
|
|||
182 | echo '% patch file after refresh' |
|
|||
183 | catpatch .hg/patches/patch |
|
|||
184 | cd .. |
|
|||
185 |
|
204 | |||
186 |
|
205 | |||
187 | echo % issue1441 with git patches |
|
206 | qrefresh --short tests: | |
188 | hg init repo-1441-git |
|
207 | ||
189 | cd repo-1441-git |
|
208 | $ echo 'orphan' > orphanchild | |
190 | echo "[diff]" >> .hg/hgrc |
|
209 | $ hg add orphanchild | |
191 | echo "git=True" >> .hg/hgrc |
|
210 | $ hg qrefresh nonexistingfilename # clear patch | |
192 | echo a > a |
|
211 | $ hg qrefresh --short 1/base | |
193 | hg add a |
|
212 | $ hg qrefresh --short 2/base | |
194 | hg qnew -f p |
|
213 | ||
195 | hg mv a b |
|
214 | $ hg qdiff | |
196 | hg qrefresh |
|
215 | diff -r e7af5904b465 1/base | |
197 | hg qdiff --nodates |
|
216 | --- a/1/base | |
198 | cd .. |
|
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 |
|
5 | $ hg init a | |
4 | echo "mq=" >> $HGRCPATH |
|
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 |
|
14 | $ hg qrename mqbase renamed | |
7 | cd a |
|
15 | $ mkdir .hg/patches/foo | |
|
16 | $ hg qrename renamed foo | |||
|
17 | ||||
|
18 | $ hg qseries | |||
|
19 | foo/renamed | |||
8 |
|
20 | |||
9 | echo 'base' > base |
|
21 | $ ls .hg/patches/foo | |
10 | hg ci -Ambase -d '1 0' |
|
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 |
|
30 | $ ls .hg/patches/bar | |
13 | hg qrename mqbase renamed |
|
31 | renamed | |
14 | mkdir .hg/patches/foo |
|
32 | ||
15 |
hg qrename renamed |
|
33 | $ hg qrename bar/renamed baz | |
16 | hg qseries |
|
34 | ||
17 | ls .hg/patches/foo |
|
35 | $ hg qseries | |
18 | mkdir .hg/patches/bar |
|
36 | baz | |
19 | hg qrename foo/renamed bar |
|
37 | ||
20 | hg qseries |
|
38 | $ ls .hg/patches/baz | |
21 |
|
|
39 | .hg/patches/baz | |
22 | hg qrename bar/renamed baz |
|
40 | ||
23 | hg qseries |
|
41 | $ hg qrename baz new/dir | |
24 | ls .hg/patches/baz |
|
42 | ||
25 | hg qrename baz new/dir |
|
43 | $ hg qseries | |
26 | hg qseries |
|
44 | new/dir | |
27 | ls .hg/patches/new/dir |
|
|||
28 | cd .. |
|
|||
29 |
|
45 | |||
30 | echo % test patch being renamed before committed |
|
46 | $ ls .hg/patches/new/dir | |
31 | hg init b |
|
47 | .hg/patches/new/dir | |
32 | cd b |
|
48 | ||
33 | hg qinit -c |
|
49 | $ cd .. | |
34 | hg qnew x |
|
50 | ||
35 | hg qrename y |
|
51 | Test patch being renamed before committed: | |
36 | hg qcommit -m rename |
|
52 | ||
37 | cd .. |
|
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 | $ hg init | |
4 | echo "mq=" >> $HGRCPATH |
|
|||
5 |
|
||||
6 | hg init a |
|
|||
7 | cd a |
|
|||
8 |
|
5 | |||
9 | echo 'base' > base |
|
6 | $ echo 'base' > base | |
10 |
hg ci -Ambase |
|
7 | $ hg ci -Ambase | |
|
8 | adding base | |||
11 |
|
9 | |||
12 | hg qnew -mmqbase mqbase |
|
10 | $ hg qnew -mmqbase mqbase | |
13 |
|
11 | |||
14 | hg qsave |
|
12 | $ hg qsave | |
15 | hg qrestore 2 |
|
13 | $ hg qrestore 2 | |
|
14 | restoring status: hg patches saved state | |||
|
15 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now