Show More
@@ -1,224 +1,224 b'' | |||||
1 | $ hg init repo |
|
1 | $ hg init repo | |
2 | $ cd repo |
|
2 | $ cd repo | |
3 | $ touch foo |
|
3 | $ touch foo | |
4 | $ hg add foo |
|
4 | $ hg add foo | |
5 | $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do |
|
5 | $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do | |
6 | > echo "foo-$i" >> foo |
|
6 | > echo "foo-$i" >> foo | |
7 | > hg ci -m "foo-$i" |
|
7 | > hg ci -m "foo-$i" | |
8 | > done |
|
8 | > done | |
9 |
|
9 | |||
10 | $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do |
|
10 | $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do | |
11 | > echo |
|
11 | > echo | |
12 | > echo "# foo-$out.patch" |
|
12 | > echo "# foo-$out.patch" | |
13 | > hg export -v -o "foo-$out.patch" 2:tip |
|
13 | > hg export -v -o "foo-$out.patch" 2:tip | |
14 | > done |
|
14 | > done | |
15 |
|
15 | |||
16 | # foo-%nof%N.patch |
|
16 | # foo-%nof%N.patch | |
17 | exporting patches: |
|
17 | exporting patches: | |
18 | foo-01of10.patch |
|
18 | foo-01of10.patch | |
19 | foo-02of10.patch |
|
19 | foo-02of10.patch | |
20 | foo-03of10.patch |
|
20 | foo-03of10.patch | |
21 | foo-04of10.patch |
|
21 | foo-04of10.patch | |
22 | foo-05of10.patch |
|
22 | foo-05of10.patch | |
23 | foo-06of10.patch |
|
23 | foo-06of10.patch | |
24 | foo-07of10.patch |
|
24 | foo-07of10.patch | |
25 | foo-08of10.patch |
|
25 | foo-08of10.patch | |
26 | foo-09of10.patch |
|
26 | foo-09of10.patch | |
27 | foo-10of10.patch |
|
27 | foo-10of10.patch | |
28 |
|
28 | |||
29 | # foo-%%%H.patch |
|
29 | # foo-%%%H.patch | |
30 | exporting patches: |
|
30 | exporting patches: | |
31 | foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch |
|
31 | foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch | |
32 | foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch |
|
32 | foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch | |
33 | foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch |
|
33 | foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch | |
34 | foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch |
|
34 | foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch | |
35 | foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch |
|
35 | foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch | |
36 | foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch |
|
36 | foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch | |
37 | foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch |
|
37 | foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch | |
38 | foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch |
|
38 | foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch | |
39 | foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch |
|
39 | foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch | |
40 | foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch |
|
40 | foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch | |
41 |
|
41 | |||
42 | # foo-%b-%R.patch |
|
42 | # foo-%b-%R.patch | |
43 | exporting patches: |
|
43 | exporting patches: | |
44 | foo-repo-2.patch |
|
44 | foo-repo-2.patch | |
45 | foo-repo-3.patch |
|
45 | foo-repo-3.patch | |
46 | foo-repo-4.patch |
|
46 | foo-repo-4.patch | |
47 | foo-repo-5.patch |
|
47 | foo-repo-5.patch | |
48 | foo-repo-6.patch |
|
48 | foo-repo-6.patch | |
49 | foo-repo-7.patch |
|
49 | foo-repo-7.patch | |
50 | foo-repo-8.patch |
|
50 | foo-repo-8.patch | |
51 | foo-repo-9.patch |
|
51 | foo-repo-9.patch | |
52 | foo-repo-10.patch |
|
52 | foo-repo-10.patch | |
53 | foo-repo-11.patch |
|
53 | foo-repo-11.patch | |
54 |
|
54 | |||
55 | # foo-%h.patch |
|
55 | # foo-%h.patch | |
56 | exporting patches: |
|
56 | exporting patches: | |
57 | foo-617188a1c80f.patch |
|
57 | foo-617188a1c80f.patch | |
58 | foo-dd41a5ff707a.patch |
|
58 | foo-dd41a5ff707a.patch | |
59 | foo-f95a5410f866.patch |
|
59 | foo-f95a5410f866.patch | |
60 | foo-4346bcfde53b.patch |
|
60 | foo-4346bcfde53b.patch | |
61 | foo-afda8c3a009c.patch |
|
61 | foo-afda8c3a009c.patch | |
62 | foo-35284ce2b6b9.patch |
|
62 | foo-35284ce2b6b9.patch | |
63 | foo-9688c41894e6.patch |
|
63 | foo-9688c41894e6.patch | |
64 | foo-747d3c68f8ec.patch |
|
64 | foo-747d3c68f8ec.patch | |
65 | foo-5f17a83f5fbd.patch |
|
65 | foo-5f17a83f5fbd.patch | |
66 | foo-f3acbafac161.patch |
|
66 | foo-f3acbafac161.patch | |
67 |
|
67 | |||
68 | # foo-%r.patch |
|
68 | # foo-%r.patch | |
69 | exporting patches: |
|
69 | exporting patches: | |
70 | foo-02.patch |
|
70 | foo-02.patch | |
71 | foo-03.patch |
|
71 | foo-03.patch | |
72 | foo-04.patch |
|
72 | foo-04.patch | |
73 | foo-05.patch |
|
73 | foo-05.patch | |
74 | foo-06.patch |
|
74 | foo-06.patch | |
75 | foo-07.patch |
|
75 | foo-07.patch | |
76 | foo-08.patch |
|
76 | foo-08.patch | |
77 | foo-09.patch |
|
77 | foo-09.patch | |
78 | foo-10.patch |
|
78 | foo-10.patch | |
79 | foo-11.patch |
|
79 | foo-11.patch | |
80 |
|
80 | |||
81 | # foo-%m.patch |
|
81 | # foo-%m.patch | |
82 | exporting patches: |
|
82 | exporting patches: | |
83 | foo-foo_2.patch |
|
83 | foo-foo_2.patch | |
84 | foo-foo_3.patch |
|
84 | foo-foo_3.patch | |
85 | foo-foo_4.patch |
|
85 | foo-foo_4.patch | |
86 | foo-foo_5.patch |
|
86 | foo-foo_5.patch | |
87 | foo-foo_6.patch |
|
87 | foo-foo_6.patch | |
88 | foo-foo_7.patch |
|
88 | foo-foo_7.patch | |
89 | foo-foo_8.patch |
|
89 | foo-foo_8.patch | |
90 | foo-foo_9.patch |
|
90 | foo-foo_9.patch | |
91 | foo-foo_10.patch |
|
91 | foo-foo_10.patch | |
92 | foo-foo_11.patch |
|
92 | foo-foo_11.patch | |
93 |
|
93 | |||
94 | Doing it again clobbers the files rather than appending: |
|
94 | Doing it again clobbers the files rather than appending: | |
95 | $ hg export -v -o "foo-%m.patch" 2:3 |
|
95 | $ hg export -v -o "foo-%m.patch" 2:3 | |
96 | exporting patches: |
|
96 | exporting patches: | |
97 | foo-foo_2.patch |
|
97 | foo-foo_2.patch | |
98 | foo-foo_3.patch |
|
98 | foo-foo_3.patch | |
99 | $ grep HG foo-foo_2.patch | wc -l |
|
99 | $ grep HG foo-foo_2.patch | wc -l | |
100 | \s*1 (re) |
|
100 | \s*1 (re) | |
101 | $ grep HG foo-foo_3.patch | wc -l |
|
101 | $ grep HG foo-foo_3.patch | wc -l | |
102 | \s*1 (re) |
|
102 | \s*1 (re) | |
103 |
|
103 | |||
104 | Exporting 4 changesets to a file: |
|
104 | Exporting 4 changesets to a file: | |
105 |
|
105 | |||
106 | $ hg export -o export_internal 1 2 3 4 |
|
106 | $ hg export -o export_internal 1 2 3 4 | |
107 | $ grep HG export_internal | wc -l |
|
107 | $ grep HG export_internal | wc -l | |
108 | \s*4 (re) |
|
108 | \s*4 (re) | |
109 |
|
109 | |||
110 | Doing it again clobbers the file rather than appending: |
|
110 | Doing it again clobbers the file rather than appending: | |
111 | $ hg export -o export_internal 1 2 3 4 |
|
111 | $ hg export -o export_internal 1 2 3 4 | |
112 | $ grep HG export_internal | wc -l |
|
112 | $ grep HG export_internal | wc -l | |
113 | \s*4 (re) |
|
113 | \s*4 (re) | |
114 |
|
114 | |||
115 | Exporting 4 changesets to stdout: |
|
115 | Exporting 4 changesets to stdout: | |
116 |
|
116 | |||
117 | $ hg export 1 2 3 4 | grep HG | wc -l |
|
117 | $ hg export 1 2 3 4 | grep HG | wc -l | |
118 | \s*4 (re) |
|
118 | \s*4 (re) | |
119 |
|
119 | |||
120 | Exporting revision -2 to a file: |
|
120 | Exporting revision -2 to a file: | |
121 |
|
121 | |||
122 | $ hg export -- -2 |
|
122 | $ hg export -- -2 | |
123 | # HG changeset patch |
|
123 | # HG changeset patch | |
124 | # User test |
|
124 | # User test | |
125 | # Date 0 0 |
|
125 | # Date 0 0 | |
126 | # Thu Jan 01 00:00:00 1970 +0000 |
|
126 | # Thu Jan 01 00:00:00 1970 +0000 | |
127 | # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd |
|
127 | # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd | |
128 | # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f |
|
128 | # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f | |
129 | foo-10 |
|
129 | foo-10 | |
130 |
|
130 | |||
131 | diff -r 747d3c68f8ec -r 5f17a83f5fbd foo |
|
131 | diff -r 747d3c68f8ec -r 5f17a83f5fbd foo | |
132 | --- a/foo Thu Jan 01 00:00:00 1970 +0000 |
|
132 | --- a/foo Thu Jan 01 00:00:00 1970 +0000 | |
133 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
133 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
134 | @@ -8,3 +8,4 @@ |
|
134 | @@ -8,3 +8,4 @@ | |
135 | foo-7 |
|
135 | foo-7 | |
136 | foo-8 |
|
136 | foo-8 | |
137 | foo-9 |
|
137 | foo-9 | |
138 | +foo-10 |
|
138 | +foo-10 | |
139 |
|
139 | |||
140 | No filename should be printed if stdout is specified explicitly: |
|
140 | No filename should be printed if stdout is specified explicitly: | |
141 |
|
141 | |||
142 | $ hg export -v 1 -o - |
|
142 | $ hg export -v 1 -o - | |
143 | exporting patch: |
|
143 | exporting patch: | |
144 | # HG changeset patch |
|
144 | # HG changeset patch | |
145 | # User test |
|
145 | # User test | |
146 | # Date 0 0 |
|
146 | # Date 0 0 | |
147 | # Thu Jan 01 00:00:00 1970 +0000 |
|
147 | # Thu Jan 01 00:00:00 1970 +0000 | |
148 | # Node ID d1c9656e973cfb5aebd5499bbd2cb350e3b12266 |
|
148 | # Node ID d1c9656e973cfb5aebd5499bbd2cb350e3b12266 | |
149 | # Parent 871558de6af2e8c244222f8eea69b782c94ce3df |
|
149 | # Parent 871558de6af2e8c244222f8eea69b782c94ce3df | |
150 | foo-1 |
|
150 | foo-1 | |
151 |
|
151 | |||
152 | diff -r 871558de6af2 -r d1c9656e973c foo |
|
152 | diff -r 871558de6af2 -r d1c9656e973c foo | |
153 | --- a/foo Thu Jan 01 00:00:00 1970 +0000 |
|
153 | --- a/foo Thu Jan 01 00:00:00 1970 +0000 | |
154 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
154 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
155 | @@ -1,1 +1,2 @@ |
|
155 | @@ -1,1 +1,2 @@ | |
156 | foo-0 |
|
156 | foo-0 | |
157 | +foo-1 |
|
157 | +foo-1 | |
158 |
|
158 | |||
159 | Checking if only alphanumeric characters are used in the file name (%m option): |
|
159 | Checking if only alphanumeric characters are used in the file name (%m option): | |
160 |
|
160 | |||
161 | $ echo "line" >> foo |
|
161 | $ echo "line" >> foo | |
162 | $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~" |
|
162 | $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]"'^'"_\`abcdefghijklmnopqrstuvwxyz{|}~" | |
163 | $ hg export -v -o %m.patch tip |
|
163 | $ hg export -v -o %m.patch tip | |
164 | exporting patch: |
|
164 | exporting patch: | |
165 | ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch |
|
165 | ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch | |
166 |
|
166 | |||
167 | Catch exporting unknown revisions (especially empty revsets, see issue3353) |
|
167 | Catch exporting unknown revisions (especially empty revsets, see issue3353) | |
168 |
|
168 | |||
169 | $ hg export |
|
169 | $ hg export | |
170 | # HG changeset patch |
|
170 | # HG changeset patch | |
171 | # User test |
|
171 | # User test | |
172 | # Date 0 0 |
|
172 | # Date 0 0 | |
173 | # Thu Jan 01 00:00:00 1970 +0000 |
|
173 | # Thu Jan 01 00:00:00 1970 +0000 | |
174 | # Node ID 197ecd81a57f760b54f34a58817ad5b04991fa47 |
|
174 | # Node ID 197ecd81a57f760b54f34a58817ad5b04991fa47 | |
175 | # Parent f3acbafac161ec68f1598af38f794f28847ca5d3 |
|
175 | # Parent f3acbafac161ec68f1598af38f794f28847ca5d3 | |
176 | !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
|
176 | !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ | |
177 |
|
177 | |||
178 | diff -r f3acbafac161 -r 197ecd81a57f foo |
|
178 | diff -r f3acbafac161 -r 197ecd81a57f foo | |
179 | --- a/foo Thu Jan 01 00:00:00 1970 +0000 |
|
179 | --- a/foo Thu Jan 01 00:00:00 1970 +0000 | |
180 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
180 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
181 | @@ -10,3 +10,4 @@ |
|
181 | @@ -10,3 +10,4 @@ | |
182 | foo-9 |
|
182 | foo-9 | |
183 | foo-10 |
|
183 | foo-10 | |
184 | foo-11 |
|
184 | foo-11 | |
185 | +line |
|
185 | +line | |
186 |
|
186 | |||
187 | $ hg export "" |
|
187 | $ hg export "" | |
188 | hg: parse error: empty query |
|
188 | hg: parse error: empty query | |
189 | [255] |
|
189 | [255] | |
190 | $ hg export 999 |
|
190 | $ hg export 999 | |
191 | abort: unknown revision '999'! |
|
191 | abort: unknown revision '999'! | |
192 | [255] |
|
192 | [255] | |
193 | $ hg export "not all()" |
|
193 | $ hg export "not all()" | |
194 | abort: export requires at least one changeset |
|
194 | abort: export requires at least one changeset | |
195 | [255] |
|
195 | [255] | |
196 |
|
196 | |||
197 | Check for color output |
|
197 | Check for color output | |
198 | $ cat <<EOF >> $HGRCPATH |
|
198 | $ cat <<EOF >> $HGRCPATH | |
199 | > [color] |
|
199 | > [color] | |
200 | > mode = ansi |
|
200 | > mode = ansi | |
201 | > [extensions] |
|
201 | > [extensions] | |
202 | > color = |
|
202 | > color = | |
203 | > EOF |
|
203 | > EOF | |
204 |
|
204 | |||
205 | $ hg export --color always --nodates tip |
|
205 | $ hg export --color always --nodates tip | |
206 | # HG changeset patch |
|
206 | # HG changeset patch | |
207 | # User test |
|
207 | # User test | |
208 | # Date 0 0 |
|
208 | # Date 0 0 | |
209 | # Thu Jan 01 00:00:00 1970 +0000 |
|
209 | # Thu Jan 01 00:00:00 1970 +0000 | |
210 | # Node ID * (glob) |
|
210 | # Node ID * (glob) | |
211 | # Parent * (glob) |
|
211 | # Parent * (glob) | |
212 | !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
|
212 | !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ | |
213 |
|
213 | |||
214 | \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc) |
|
214 | \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc) | |
215 | \x1b[0;31;1m--- a/foo\x1b[0m (esc) |
|
215 | \x1b[0;31;1m--- a/foo\x1b[0m (esc) | |
216 | \x1b[0;32;1m+++ b/foo\x1b[0m (esc) |
|
216 | \x1b[0;32;1m+++ b/foo\x1b[0m (esc) | |
217 | \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc) |
|
217 | \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc) | |
218 | foo-9 |
|
218 | foo-9 | |
219 | foo-10 |
|
219 | foo-10 | |
220 | foo-11 |
|
220 | foo-11 | |
221 | \x1b[0;32m+line\x1b[0m (esc) |
|
221 | \x1b[0;32m+line\x1b[0m (esc) | |
222 |
|
222 | |||
223 |
|
223 | |||
224 | $ cd .. |
|
224 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now