Show More
@@ -1,265 +1,266 b'' | |||||
1 | $ mkdir test |
|
1 | $ mkdir test | |
2 | $ cd test |
|
2 | $ cd test | |
3 | $ hg init |
|
3 | $ hg init | |
4 | $ echo foo>foo |
|
4 | $ echo foo>foo | |
5 | $ hg commit -Am 1 -d '1 0' |
|
5 | $ hg commit -Am 1 -d '1 0' | |
6 | adding foo |
|
6 | adding foo | |
7 | $ echo bar>bar |
|
7 | $ echo bar>bar | |
8 | $ hg commit -Am 2 -d '2 0' |
|
8 | $ hg commit -Am 2 -d '2 0' | |
9 | adding bar |
|
9 | adding bar | |
10 | $ mkdir baz |
|
10 | $ mkdir baz | |
11 | $ echo bletch>baz/bletch |
|
11 | $ echo bletch>baz/bletch | |
12 | $ hg commit -Am 3 -d '1000000000 0' |
|
12 | $ hg commit -Am 3 -d '1000000000 0' | |
13 | adding baz/bletch |
|
13 | adding baz/bletch | |
14 | $ echo "[web]" >> .hg/hgrc |
|
14 | $ echo "[web]" >> .hg/hgrc | |
15 | $ echo "name = test-archive" >> .hg/hgrc |
|
15 | $ echo "name = test-archive" >> .hg/hgrc | |
16 | $ cp .hg/hgrc .hg/hgrc-base |
|
16 | $ cp .hg/hgrc .hg/hgrc-base | |
17 | > test_archtype() { |
|
17 | > test_archtype() { | |
18 | > echo "allow_archive = $1" >> .hg/hgrc |
|
18 | > echo "allow_archive = $1" >> .hg/hgrc | |
19 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
19 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
20 | > cat hg.pid >> $DAEMON_PIDS |
|
20 | > cat hg.pid >> $DAEMON_PIDS | |
21 | > echo % $1 allowed should give 200 |
|
21 | > echo % $1 allowed should give 200 | |
22 | > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$2" | head -n 1 |
|
22 | > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$2" | head -n 1 | |
23 | > echo % $3 and $4 disallowed should both give 403 |
|
23 | > echo % $3 and $4 disallowed should both give 403 | |
24 | > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$3" | head -n 1 |
|
24 | > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$3" | head -n 1 | |
25 | > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$4" | head -n 1 |
|
25 | > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.$4" | head -n 1 | |
26 | > "$TESTDIR/killdaemons.py" |
|
26 | > "$TESTDIR/killdaemons.py" | |
27 | > cat errors.log |
|
27 | > cat errors.log | |
28 | > cp .hg/hgrc-base .hg/hgrc |
|
28 | > cp .hg/hgrc-base .hg/hgrc | |
29 | > } |
|
29 | > } | |
30 |
|
30 | |||
31 | check http return codes |
|
31 | check http return codes | |
32 |
|
32 | |||
33 | $ test_archtype gz tar.gz tar.bz2 zip |
|
33 | $ test_archtype gz tar.gz tar.bz2 zip | |
34 | % gz allowed should give 200 |
|
34 | % gz allowed should give 200 | |
35 | 200 Script output follows |
|
35 | 200 Script output follows | |
36 | % tar.bz2 and zip disallowed should both give 403 |
|
36 | % tar.bz2 and zip disallowed should both give 403 | |
37 | 403 Archive type not allowed: bz2 |
|
37 | 403 Archive type not allowed: bz2 | |
38 | 403 Archive type not allowed: zip |
|
38 | 403 Archive type not allowed: zip | |
39 | $ test_archtype bz2 tar.bz2 zip tar.gz |
|
39 | $ test_archtype bz2 tar.bz2 zip tar.gz | |
40 | % bz2 allowed should give 200 |
|
40 | % bz2 allowed should give 200 | |
41 | 200 Script output follows |
|
41 | 200 Script output follows | |
42 | % zip and tar.gz disallowed should both give 403 |
|
42 | % zip and tar.gz disallowed should both give 403 | |
43 | 403 Archive type not allowed: zip |
|
43 | 403 Archive type not allowed: zip | |
44 | 403 Archive type not allowed: gz |
|
44 | 403 Archive type not allowed: gz | |
45 | $ test_archtype zip zip tar.gz tar.bz2 |
|
45 | $ test_archtype zip zip tar.gz tar.bz2 | |
46 | % zip allowed should give 200 |
|
46 | % zip allowed should give 200 | |
47 | 200 Script output follows |
|
47 | 200 Script output follows | |
48 | % tar.gz and tar.bz2 disallowed should both give 403 |
|
48 | % tar.gz and tar.bz2 disallowed should both give 403 | |
49 | 403 Archive type not allowed: gz |
|
49 | 403 Archive type not allowed: gz | |
50 | 403 Archive type not allowed: bz2 |
|
50 | 403 Archive type not allowed: bz2 | |
51 |
|
51 | |||
52 | $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc |
|
52 | $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc | |
53 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
53 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
54 | $ cat hg.pid >> $DAEMON_PIDS |
|
54 | $ cat hg.pid >> $DAEMON_PIDS | |
55 |
|
55 | |||
56 | invalid arch type should give 404 |
|
56 | invalid arch type should give 404 | |
57 |
|
57 | |||
58 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.invalid" | head -n 1 |
|
58 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/archive/tip.invalid" | head -n 1 | |
59 | 404 Unsupported archive type: None |
|
59 | 404 Unsupported archive type: None | |
60 |
|
60 | |||
61 | $ TIP=`hg id -v | cut -f1 -d' '` |
|
61 | $ TIP=`hg id -v | cut -f1 -d' '` | |
62 | $ QTIP=`hg id -q` |
|
62 | $ QTIP=`hg id -q` | |
63 | $ cat > getarchive.py <<EOF |
|
63 | $ cat > getarchive.py <<EOF | |
64 | > import os, sys, urllib2 |
|
64 | > import os, sys, urllib2 | |
65 | > try: |
|
65 | > try: | |
66 | > # Set stdout to binary mode for win32 platforms |
|
66 | > # Set stdout to binary mode for win32 platforms | |
67 | > import msvcrt |
|
67 | > import msvcrt | |
68 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
68 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
69 | > except ImportError: |
|
69 | > except ImportError: | |
70 | > pass |
|
70 | > pass | |
71 | > node, archive = sys.argv[1:] |
|
71 | > node, archive = sys.argv[1:] | |
72 | > f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s' |
|
72 | > f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s' | |
73 | > % (os.environ['HGPORT'], node, archive)) |
|
73 | > % (os.environ['HGPORT'], node, archive)) | |
74 | > sys.stdout.write(f.read()) |
|
74 | > sys.stdout.write(f.read()) | |
75 | > EOF |
|
75 | > EOF | |
76 | $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null |
|
76 | $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null | |
77 | test-archive-2c0277f05ed4/.hg_archival.txt |
|
77 | test-archive-2c0277f05ed4/.hg_archival.txt | |
78 | test-archive-2c0277f05ed4/bar |
|
78 | test-archive-2c0277f05ed4/bar | |
79 | test-archive-2c0277f05ed4/baz/bletch |
|
79 | test-archive-2c0277f05ed4/baz/bletch | |
80 | test-archive-2c0277f05ed4/foo |
|
80 | test-archive-2c0277f05ed4/foo | |
81 | $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null |
|
81 | $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null | |
82 | test-archive-2c0277f05ed4/.hg_archival.txt |
|
82 | test-archive-2c0277f05ed4/.hg_archival.txt | |
83 | test-archive-2c0277f05ed4/bar |
|
83 | test-archive-2c0277f05ed4/bar | |
84 | test-archive-2c0277f05ed4/baz/bletch |
|
84 | test-archive-2c0277f05ed4/baz/bletch | |
85 | test-archive-2c0277f05ed4/foo |
|
85 | test-archive-2c0277f05ed4/foo | |
86 | $ python getarchive.py "$TIP" zip > archive.zip |
|
86 | $ python getarchive.py "$TIP" zip > archive.zip | |
87 | $ unzip -t archive.zip |
|
87 | $ unzip -t archive.zip | |
88 | Archive: archive.zip |
|
88 | Archive: archive.zip | |
89 | testing: test-archive-2c0277f05ed4/.hg_archival.txt OK |
|
89 | testing: test-archive-2c0277f05ed4/.hg_archival.txt OK | |
90 | testing: test-archive-2c0277f05ed4/bar OK |
|
90 | testing: test-archive-2c0277f05ed4/bar OK | |
91 | testing: test-archive-2c0277f05ed4/baz/bletch OK |
|
91 | testing: test-archive-2c0277f05ed4/baz/bletch OK | |
92 | testing: test-archive-2c0277f05ed4/foo OK |
|
92 | testing: test-archive-2c0277f05ed4/foo OK | |
93 | No errors detected in compressed data of archive.zip. |
|
93 | No errors detected in compressed data of archive.zip. | |
94 |
|
94 | |||
95 | $ "$TESTDIR/killdaemons.py" |
|
95 | $ "$TESTDIR/killdaemons.py" | |
96 |
|
96 | |||
97 | $ hg archive -t tar test.tar |
|
97 | $ hg archive -t tar test.tar | |
98 | $ tar tf test.tar |
|
98 | $ tar tf test.tar | |
99 | test/.hg_archival.txt |
|
99 | test/.hg_archival.txt | |
100 | test/bar |
|
100 | test/bar | |
101 | test/baz/bletch |
|
101 | test/baz/bletch | |
102 | test/foo |
|
102 | test/foo | |
103 |
|
103 | |||
104 | $ hg archive -t tbz2 -X baz test.tar.bz2 |
|
104 | $ hg archive -t tbz2 -X baz test.tar.bz2 | |
105 | $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null |
|
105 | $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null | |
106 | test/.hg_archival.txt |
|
106 | test/.hg_archival.txt | |
107 | test/bar |
|
107 | test/bar | |
108 | test/foo |
|
108 | test/foo | |
109 |
|
109 | |||
110 | $ hg archive -t tgz -p %b-%h test-%h.tar.gz |
|
110 | $ hg archive -t tgz -p %b-%h test-%h.tar.gz | |
111 | $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null |
|
111 | $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null | |
112 | test-2c0277f05ed4/.hg_archival.txt |
|
112 | test-2c0277f05ed4/.hg_archival.txt | |
113 | test-2c0277f05ed4/bar |
|
113 | test-2c0277f05ed4/bar | |
114 | test-2c0277f05ed4/baz/bletch |
|
114 | test-2c0277f05ed4/baz/bletch | |
115 | test-2c0277f05ed4/foo |
|
115 | test-2c0277f05ed4/foo | |
116 |
|
116 | |||
117 | $ hg archive autodetected_test.tar |
|
117 | $ hg archive autodetected_test.tar | |
118 | $ tar tf autodetected_test.tar |
|
118 | $ tar tf autodetected_test.tar | |
119 | autodetected_test/.hg_archival.txt |
|
119 | autodetected_test/.hg_archival.txt | |
120 | autodetected_test/bar |
|
120 | autodetected_test/bar | |
121 | autodetected_test/baz/bletch |
|
121 | autodetected_test/baz/bletch | |
122 | autodetected_test/foo |
|
122 | autodetected_test/foo | |
123 |
|
123 | |||
124 | The '-t' should override autodetection |
|
124 | The '-t' should override autodetection | |
125 |
|
125 | |||
126 | $ hg archive -t tar autodetect_override_test.zip |
|
126 | $ hg archive -t tar autodetect_override_test.zip | |
127 | $ tar tf autodetect_override_test.zip |
|
127 | $ tar tf autodetect_override_test.zip | |
128 | autodetect_override_test.zip/.hg_archival.txt |
|
128 | autodetect_override_test.zip/.hg_archival.txt | |
129 | autodetect_override_test.zip/bar |
|
129 | autodetect_override_test.zip/bar | |
130 | autodetect_override_test.zip/baz/bletch |
|
130 | autodetect_override_test.zip/baz/bletch | |
131 | autodetect_override_test.zip/foo |
|
131 | autodetect_override_test.zip/foo | |
132 |
|
132 | |||
133 | $ for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do |
|
133 | $ for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do | |
134 | > hg archive auto_test.$ext |
|
134 | > hg archive auto_test.$ext | |
135 | > if [ -d auto_test.$ext ]; then |
|
135 | > if [ -d auto_test.$ext ]; then | |
136 | > echo "extension $ext was not autodetected." |
|
136 | > echo "extension $ext was not autodetected." | |
137 | > fi |
|
137 | > fi | |
138 | > done |
|
138 | > done | |
139 |
|
139 | |||
140 | $ cat > md5comp.py <<EOF |
|
140 | $ cat > md5comp.py <<EOF | |
141 | > try: |
|
141 | > try: | |
142 | > from hashlib import md5 |
|
142 | > from hashlib import md5 | |
143 | > except ImportError: |
|
143 | > except ImportError: | |
144 | > from md5 import md5 |
|
144 | > from md5 import md5 | |
145 | > import sys |
|
145 | > import sys | |
146 | > f1, f2 = sys.argv[1:3] |
|
146 | > f1, f2 = sys.argv[1:3] | |
147 | > h1 = md5(file(f1, 'rb').read()).hexdigest() |
|
147 | > h1 = md5(file(f1, 'rb').read()).hexdigest() | |
148 | > h2 = md5(file(f2, 'rb').read()).hexdigest() |
|
148 | > h2 = md5(file(f2, 'rb').read()).hexdigest() | |
149 | > print h1 == h2 or "md5 differ: " + repr((h1, h2)) |
|
149 | > print h1 == h2 or "md5 differ: " + repr((h1, h2)) | |
150 | > EOF |
|
150 | > EOF | |
151 |
|
151 | |||
152 | archive name is stored in the archive, so create similar archives and |
|
152 | archive name is stored in the archive, so create similar archives and | |
153 | rename them afterwards. |
|
153 | rename them afterwards. | |
154 |
|
154 | |||
155 | $ hg archive -t tgz tip.tar.gz |
|
155 | $ hg archive -t tgz tip.tar.gz | |
156 | $ mv tip.tar.gz tip1.tar.gz |
|
156 | $ mv tip.tar.gz tip1.tar.gz | |
157 | $ sleep 1 |
|
157 | $ sleep 1 | |
158 | $ hg archive -t tgz tip.tar.gz |
|
158 | $ hg archive -t tgz tip.tar.gz | |
159 | $ mv tip.tar.gz tip2.tar.gz |
|
159 | $ mv tip.tar.gz tip2.tar.gz | |
160 | $ python md5comp.py tip1.tar.gz tip2.tar.gz |
|
160 | $ python md5comp.py tip1.tar.gz tip2.tar.gz | |
161 | True |
|
161 | True | |
162 |
|
162 | |||
163 | $ hg archive -t zip -p /illegal test.zip |
|
163 | $ hg archive -t zip -p /illegal test.zip | |
164 | abort: archive prefix contains illegal components |
|
164 | abort: archive prefix contains illegal components | |
165 | [255] |
|
165 | [255] | |
166 | $ hg archive -t zip -p very/../bad test.zip |
|
166 | $ hg archive -t zip -p very/../bad test.zip | |
167 |
|
167 | |||
168 | $ hg archive --config ui.archivemeta=false -t zip -r 2 test.zip |
|
168 | $ hg archive --config ui.archivemeta=false -t zip -r 2 test.zip | |
169 | $ unzip -t test.zip |
|
169 | $ unzip -t test.zip | |
170 | Archive: test.zip |
|
170 | Archive: test.zip | |
171 | testing: test/bar OK |
|
171 | testing: test/bar OK | |
172 | testing: test/baz/bletch OK |
|
172 | testing: test/baz/bletch OK | |
173 | testing: test/foo OK |
|
173 | testing: test/foo OK | |
174 | No errors detected in compressed data of test.zip. |
|
174 | No errors detected in compressed data of test.zip. | |
175 |
|
175 | |||
176 | $ hg archive -t tar - | tar tf - 2>/dev/null |
|
176 | $ hg archive -t tar - | tar tf - 2>/dev/null | |
177 | test-2c0277f05ed4/.hg_archival.txt |
|
177 | test-2c0277f05ed4/.hg_archival.txt | |
178 | test-2c0277f05ed4/bar |
|
178 | test-2c0277f05ed4/bar | |
179 | test-2c0277f05ed4/baz/bletch |
|
179 | test-2c0277f05ed4/baz/bletch | |
180 | test-2c0277f05ed4/foo |
|
180 | test-2c0277f05ed4/foo | |
181 |
|
181 | |||
182 | $ hg archive -r 0 -t tar rev-%r.tar |
|
182 | $ hg archive -r 0 -t tar rev-%r.tar | |
183 | $ if [ -f rev-0.tar ]; then |
|
183 | $ if [ -f rev-0.tar ]; then | |
184 | $ fi |
|
184 | $ fi | |
185 |
|
185 | |||
186 | test .hg_archival.txt |
|
186 | test .hg_archival.txt | |
187 |
|
187 | |||
188 | $ hg archive ../test-tags |
|
188 | $ hg archive ../test-tags | |
189 | $ cat ../test-tags/.hg_archival.txt |
|
189 | $ cat ../test-tags/.hg_archival.txt | |
190 | repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 |
|
190 | repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 | |
191 | node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e |
|
191 | node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e | |
192 | branch: default |
|
192 | branch: default | |
193 | latesttag: null |
|
193 | latesttag: null | |
194 | latesttagdistance: 3 |
|
194 | latesttagdistance: 3 | |
195 | $ hg tag -r 2 mytag |
|
195 | $ hg tag -r 2 mytag | |
196 | $ hg tag -r 2 anothertag |
|
196 | $ hg tag -r 2 anothertag | |
197 | $ hg archive -r 2 ../test-lasttag |
|
197 | $ hg archive -r 2 ../test-lasttag | |
198 | $ cat ../test-lasttag/.hg_archival.txt |
|
198 | $ cat ../test-lasttag/.hg_archival.txt | |
199 | repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 |
|
199 | repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 | |
200 | node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e |
|
200 | node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e | |
201 | branch: default |
|
201 | branch: default | |
202 | tag: anothertag |
|
202 | tag: anothertag | |
203 | tag: mytag |
|
203 | tag: mytag | |
204 |
|
204 | |||
205 | $ hg archive -t bogus test.bogus |
|
205 | $ hg archive -t bogus test.bogus | |
206 | abort: unknown archive type 'bogus' |
|
206 | abort: unknown archive type 'bogus' | |
207 | [255] |
|
207 | [255] | |
208 |
|
208 | |||
209 | enable progress extension: |
|
209 | enable progress extension: | |
210 |
|
210 | |||
211 | $ cp $HGRCPATH $HGRCPATH.no-progress |
|
211 | $ cp $HGRCPATH $HGRCPATH.no-progress | |
212 | $ cat >> $HGRCPATH <<EOF |
|
212 | $ cat >> $HGRCPATH <<EOF | |
213 | > [extensions] |
|
213 | > [extensions] | |
214 | > progress = |
|
214 | > progress = | |
215 | > [progress] |
|
215 | > [progress] | |
216 | > assume-tty = 1 |
|
216 | > assume-tty = 1 | |
|
217 | > format = topic bar number | |||
217 | > delay = 0 |
|
218 | > delay = 0 | |
218 | > refresh = 0 |
|
219 | > refresh = 0 | |
219 | > width = 60 |
|
220 | > width = 60 | |
220 | > EOF |
|
221 | > EOF | |
221 |
|
222 | |||
222 | $ hg archive ../with-progress 2>&1 | $TESTDIR/filtercr.py |
|
223 | $ hg archive ../with-progress 2>&1 | $TESTDIR/filtercr.py | |
223 |
|
224 | |||
224 | archiving [ ] 0/4 |
|
225 | archiving [ ] 0/4 | |
225 | archiving [ ] 0/4 |
|
226 | archiving [ ] 0/4 | |
226 | archiving [=========> ] 1/4 |
|
227 | archiving [=========> ] 1/4 | |
227 | archiving [=========> ] 1/4 |
|
228 | archiving [=========> ] 1/4 | |
228 | archiving [====================> ] 2/4 |
|
229 | archiving [====================> ] 2/4 | |
229 | archiving [====================> ] 2/4 |
|
230 | archiving [====================> ] 2/4 | |
230 | archiving [===============================> ] 3/4 |
|
231 | archiving [===============================> ] 3/4 | |
231 | archiving [===============================> ] 3/4 |
|
232 | archiving [===============================> ] 3/4 | |
232 | archiving [==========================================>] 4/4 |
|
233 | archiving [==========================================>] 4/4 | |
233 | archiving [==========================================>] 4/4 |
|
234 | archiving [==========================================>] 4/4 | |
234 | \r (esc) |
|
235 | \r (esc) | |
235 |
|
236 | |||
236 | cleanup after progress extension test: |
|
237 | cleanup after progress extension test: | |
237 |
|
238 | |||
238 | $ cp $HGRCPATH.no-progress $HGRCPATH |
|
239 | $ cp $HGRCPATH.no-progress $HGRCPATH | |
239 |
|
240 | |||
240 | server errors |
|
241 | server errors | |
241 |
|
242 | |||
242 | $ cat errors.log |
|
243 | $ cat errors.log | |
243 |
|
244 | |||
244 | empty repo |
|
245 | empty repo | |
245 |
|
246 | |||
246 | $ hg init ../empty |
|
247 | $ hg init ../empty | |
247 | $ cd ../empty |
|
248 | $ cd ../empty | |
248 | $ hg archive ../test-empty |
|
249 | $ hg archive ../test-empty | |
249 | abort: no working directory: please specify a revision |
|
250 | abort: no working directory: please specify a revision | |
250 | [255] |
|
251 | [255] | |
251 |
|
252 | |||
252 | old file -- date clamped to 1980 |
|
253 | old file -- date clamped to 1980 | |
253 |
|
254 | |||
254 | $ touch -t 197501010000 old |
|
255 | $ touch -t 197501010000 old | |
255 | $ hg add old |
|
256 | $ hg add old | |
256 | $ hg commit -m old |
|
257 | $ hg commit -m old | |
257 | $ hg archive ../old.zip |
|
258 | $ hg archive ../old.zip | |
258 | $ unzip -l ../old.zip |
|
259 | $ unzip -l ../old.zip | |
259 | Archive: ../old.zip |
|
260 | Archive: ../old.zip | |
260 | \s*Length.* (re) |
|
261 | \s*Length.* (re) | |
261 | *-----* (glob) |
|
262 | *-----* (glob) | |
262 | *147*80*00:00*old/.hg_archival.txt (glob) |
|
263 | *147*80*00:00*old/.hg_archival.txt (glob) | |
263 | *0*80*00:00*old/old (glob) |
|
264 | *0*80*00:00*old/old (glob) | |
264 | *-----* (glob) |
|
265 | *-----* (glob) | |
265 | \s*147\s+2 files (re) |
|
266 | \s*147\s+2 files (re) |
@@ -1,247 +1,248 b'' | |||||
1 |
|
1 | |||
2 | $ "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
2 | $ "$TESTDIR/hghave" svn svn-bindings || exit 80 | |
3 |
|
3 | |||
4 | $ fixpath() |
|
4 | $ fixpath() | |
5 | > { |
|
5 | > { | |
6 | > tr '\\' / |
|
6 | > tr '\\' / | |
7 | > } |
|
7 | > } | |
8 | $ cat > $HGRCPATH <<EOF |
|
8 | $ cat > $HGRCPATH <<EOF | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > convert = |
|
10 | > convert = | |
11 | > graphlog = |
|
11 | > graphlog = | |
12 | > EOF |
|
12 | > EOF | |
13 |
|
13 | |||
14 | $ svnadmin create svn-repo |
|
14 | $ svnadmin create svn-repo | |
15 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump" |
|
15 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump" | |
16 | $ svnpath=`pwd | fixpath` |
|
16 | $ svnpath=`pwd | fixpath` | |
17 |
|
17 | |||
18 | SVN wants all paths to start with a slash. Unfortunately, |
|
18 | SVN wants all paths to start with a slash. Unfortunately, | |
19 | Windows ones don't. Handle that. |
|
19 | Windows ones don't. Handle that. | |
20 |
|
20 | |||
21 | $ expr "$svnpath" : "\/" > /dev/null |
|
21 | $ expr "$svnpath" : "\/" > /dev/null | |
22 | > if [ $? -ne 0 ]; then |
|
22 | > if [ $? -ne 0 ]; then | |
23 | > svnpath="/$svnpath" |
|
23 | > svnpath="/$svnpath" | |
24 | > fi |
|
24 | > fi | |
25 | > svnurl="file://$svnpath/svn-repo" |
|
25 | > svnurl="file://$svnpath/svn-repo" | |
26 |
|
26 | |||
27 | Convert trunk and branches |
|
27 | Convert trunk and branches | |
28 |
|
28 | |||
29 | $ hg convert --datesort "$svnurl"/subproject A-hg |
|
29 | $ hg convert --datesort "$svnurl"/subproject A-hg | |
30 | initializing destination A-hg repository |
|
30 | initializing destination A-hg repository | |
31 | scanning source... |
|
31 | scanning source... | |
32 | sorting... |
|
32 | sorting... | |
33 | converting... |
|
33 | converting... | |
34 | 13 createtrunk |
|
34 | 13 createtrunk | |
35 | 12 moved1 |
|
35 | 12 moved1 | |
36 | 11 moved1 |
|
36 | 11 moved1 | |
37 | 10 moved2 |
|
37 | 10 moved2 | |
38 | 9 changeb and rm d2 |
|
38 | 9 changeb and rm d2 | |
39 | 8 changeb and rm d2 |
|
39 | 8 changeb and rm d2 | |
40 | 7 moved1again |
|
40 | 7 moved1again | |
41 | 6 moved1again |
|
41 | 6 moved1again | |
42 | 5 copyfilefrompast |
|
42 | 5 copyfilefrompast | |
43 | 4 copydirfrompast |
|
43 | 4 copydirfrompast | |
44 | 3 add d3 |
|
44 | 3 add d3 | |
45 | 2 copy dir and remove subdir |
|
45 | 2 copy dir and remove subdir | |
46 | 1 add d4old |
|
46 | 1 add d4old | |
47 | 0 rename d4old into d4new |
|
47 | 0 rename d4old into d4new | |
48 |
|
48 | |||
49 | $ cd A-hg |
|
49 | $ cd A-hg | |
50 | $ hg glog --template '{rev} {desc|firstline} files: {files}\n' |
|
50 | $ hg glog --template '{rev} {desc|firstline} files: {files}\n' | |
51 | o 13 rename d4old into d4new files: d4new/g d4old/g |
|
51 | o 13 rename d4old into d4new files: d4new/g d4old/g | |
52 | | |
|
52 | | | |
53 | o 12 add d4old files: d4old/g |
|
53 | o 12 add d4old files: d4old/g | |
54 | | |
|
54 | | | |
55 | o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f |
|
55 | o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f | |
56 | | |
|
56 | | | |
57 | o 10 add d3 files: d3/d31/e d3/f |
|
57 | o 10 add d3 files: d3/d31/e d3/f | |
58 | | |
|
58 | | | |
59 | o 9 copydirfrompast files: d2/d |
|
59 | o 9 copydirfrompast files: d2/d | |
60 | | |
|
60 | | | |
61 | o 8 copyfilefrompast files: d |
|
61 | o 8 copyfilefrompast files: d | |
62 | | |
|
62 | | | |
63 | o 7 moved1again files: d1/b d1/c |
|
63 | o 7 moved1again files: d1/b d1/c | |
64 | | |
|
64 | | | |
65 | | o 6 moved1again files: |
|
65 | | o 6 moved1again files: | |
66 | | | |
|
66 | | | | |
67 | o | 5 changeb and rm d2 files: d1/b d2/d |
|
67 | o | 5 changeb and rm d2 files: d1/b d2/d | |
68 | | | |
|
68 | | | | |
69 | | o 4 changeb and rm d2 files: b |
|
69 | | o 4 changeb and rm d2 files: b | |
70 | | | |
|
70 | | | | |
71 | o | 3 moved2 files: d2/d |
|
71 | o | 3 moved2 files: d2/d | |
72 | | | |
|
72 | | | | |
73 | o | 2 moved1 files: d1/b d1/c |
|
73 | o | 2 moved1 files: d1/b d1/c | |
74 | | | |
|
74 | | | | |
75 | | o 1 moved1 files: b c |
|
75 | | o 1 moved1 files: b c | |
76 | | |
|
76 | | | |
77 | o 0 createtrunk files: |
|
77 | o 0 createtrunk files: | |
78 |
|
78 | |||
79 |
|
79 | |||
80 | Check move copy records |
|
80 | Check move copy records | |
81 |
|
81 | |||
82 | $ hg st --rev 12:13 --copies |
|
82 | $ hg st --rev 12:13 --copies | |
83 | A d4new/g |
|
83 | A d4new/g | |
84 | d4old/g |
|
84 | d4old/g | |
85 | R d4old/g |
|
85 | R d4old/g | |
86 |
|
86 | |||
87 | Check branches |
|
87 | Check branches | |
88 |
|
88 | |||
89 | $ hg branches |
|
89 | $ hg branches | |
90 | default 13:* (glob) |
|
90 | default 13:* (glob) | |
91 | d1 6:* (glob) |
|
91 | d1 6:* (glob) | |
92 | $ cd .. |
|
92 | $ cd .. | |
93 |
|
93 | |||
94 | $ mkdir test-replace |
|
94 | $ mkdir test-replace | |
95 | $ cd test-replace |
|
95 | $ cd test-replace | |
96 | $ svnadmin create svn-repo |
|
96 | $ svnadmin create svn-repo | |
97 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump" |
|
97 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump" | |
98 |
|
98 | |||
99 | Convert files being replaced by directories |
|
99 | Convert files being replaced by directories | |
100 |
|
100 | |||
101 | $ hg convert svn-repo hg-repo |
|
101 | $ hg convert svn-repo hg-repo | |
102 | initializing destination hg-repo repository |
|
102 | initializing destination hg-repo repository | |
103 | scanning source... |
|
103 | scanning source... | |
104 | sorting... |
|
104 | sorting... | |
105 | converting... |
|
105 | converting... | |
106 | 6 initial |
|
106 | 6 initial | |
107 | 5 clobber symlink |
|
107 | 5 clobber symlink | |
108 | 4 clobber1 |
|
108 | 4 clobber1 | |
109 | 3 clobber2 |
|
109 | 3 clobber2 | |
110 | 2 adddb |
|
110 | 2 adddb | |
111 | 1 branch |
|
111 | 1 branch | |
112 | 0 clobberdir |
|
112 | 0 clobberdir | |
113 |
|
113 | |||
114 | $ cd hg-repo |
|
114 | $ cd hg-repo | |
115 |
|
115 | |||
116 | Manifest before |
|
116 | Manifest before | |
117 |
|
117 | |||
118 | $ hg -v manifest -r 1 |
|
118 | $ hg -v manifest -r 1 | |
119 | 644 a |
|
119 | 644 a | |
120 | 644 d/b |
|
120 | 644 d/b | |
121 | 644 d2/a |
|
121 | 644 d2/a | |
122 | 644 @ dlink |
|
122 | 644 @ dlink | |
123 | 644 @ dlink2 |
|
123 | 644 @ dlink2 | |
124 | 644 dlink3 |
|
124 | 644 dlink3 | |
125 |
|
125 | |||
126 | Manifest after clobber1 |
|
126 | Manifest after clobber1 | |
127 |
|
127 | |||
128 | $ hg -v manifest -r 2 |
|
128 | $ hg -v manifest -r 2 | |
129 | 644 a/b |
|
129 | 644 a/b | |
130 | 644 d/b |
|
130 | 644 d/b | |
131 | 644 d2/a |
|
131 | 644 d2/a | |
132 | 644 dlink/b |
|
132 | 644 dlink/b | |
133 | 644 @ dlink2 |
|
133 | 644 @ dlink2 | |
134 | 644 dlink3 |
|
134 | 644 dlink3 | |
135 |
|
135 | |||
136 | Manifest after clobber2 |
|
136 | Manifest after clobber2 | |
137 |
|
137 | |||
138 | $ hg -v manifest -r 3 |
|
138 | $ hg -v manifest -r 3 | |
139 | 644 a/b |
|
139 | 644 a/b | |
140 | 644 d/b |
|
140 | 644 d/b | |
141 | 644 d2/a |
|
141 | 644 d2/a | |
142 | 644 dlink/b |
|
142 | 644 dlink/b | |
143 | 644 @ dlink2 |
|
143 | 644 @ dlink2 | |
144 | 644 @ dlink3 |
|
144 | 644 @ dlink3 | |
145 |
|
145 | |||
146 | Manifest after clobberdir |
|
146 | Manifest after clobberdir | |
147 |
|
147 | |||
148 | $ hg -v manifest -r 6 |
|
148 | $ hg -v manifest -r 6 | |
149 | 644 a/b |
|
149 | 644 a/b | |
150 | 644 d/b |
|
150 | 644 d/b | |
151 | 644 d2/a |
|
151 | 644 d2/a | |
152 | 644 d2/c |
|
152 | 644 d2/c | |
153 | 644 dlink/b |
|
153 | 644 dlink/b | |
154 | 644 @ dlink2 |
|
154 | 644 @ dlink2 | |
155 | 644 @ dlink3 |
|
155 | 644 @ dlink3 | |
156 |
|
156 | |||
157 | Try updating |
|
157 | Try updating | |
158 |
|
158 | |||
159 | $ hg up -qC default |
|
159 | $ hg up -qC default | |
160 | $ cd .. |
|
160 | $ cd .. | |
161 |
|
161 | |||
162 | Test convert progress bar' |
|
162 | Test convert progress bar' | |
163 |
|
163 | |||
164 | $ cat >> $HGRCPATH <<EOF |
|
164 | $ cat >> $HGRCPATH <<EOF | |
165 | > [extensions] |
|
165 | > [extensions] | |
166 | > progress = |
|
166 | > progress = | |
167 | > [progress] |
|
167 | > [progress] | |
168 | > assume-tty = 1 |
|
168 | > assume-tty = 1 | |
169 | > delay = 0 |
|
169 | > delay = 0 | |
|
170 | > format = topic bar number | |||
170 | > refresh = 0 |
|
171 | > refresh = 0 | |
171 | > width = 60 |
|
172 | > width = 60 | |
172 | > EOF |
|
173 | > EOF | |
173 |
|
174 | |||
174 |
$ |
|
175 | $ hg convert svn-repo hg-progress 2>&1 | $TESTDIR/filtercr.py | |
175 |
|
176 | |||
176 | scanning [ <=> ] 1 |
|
177 | scanning [ <=> ] 1 | |
177 | scanning [ <=> ] 2 |
|
178 | scanning [ <=> ] 2 | |
178 | scanning [ <=> ] 3 |
|
179 | scanning [ <=> ] 3 | |
179 | scanning [ <=> ] 4 |
|
180 | scanning [ <=> ] 4 | |
180 | scanning [ <=> ] 5 |
|
181 | scanning [ <=> ] 5 | |
181 | scanning [ <=> ] 6 |
|
182 | scanning [ <=> ] 6 | |
182 | scanning [ <=> ] 7 |
|
183 | scanning [ <=> ] 7 | |
183 |
|
184 | |||
184 | converting [ ] 0/7 |
|
185 | converting [ ] 0/7 | |
185 | getting files [=====> ] 1/6 |
|
186 | getting files [=====> ] 1/6 | |
186 | getting files [============> ] 2/6 |
|
187 | getting files [============> ] 2/6 | |
187 | getting files [==================> ] 3/6 |
|
188 | getting files [==================> ] 3/6 | |
188 | getting files [=========================> ] 4/6 |
|
189 | getting files [=========================> ] 4/6 | |
189 | getting files [===============================> ] 5/6 |
|
190 | getting files [===============================> ] 5/6 | |
190 | getting files [======================================>] 6/6 |
|
191 | getting files [======================================>] 6/6 | |
191 |
|
192 | |||
192 | converting [=====> ] 1/7 |
|
193 | converting [=====> ] 1/7 | |
193 | scanning paths [ ] 0/1 |
|
194 | scanning paths [ ] 0/1 | |
194 | getting files [======================================>] 1/1 |
|
195 | getting files [======================================>] 1/1 | |
195 |
|
196 | |||
196 | converting [===========> ] 2/7 |
|
197 | converting [===========> ] 2/7 | |
197 | scanning paths [ ] 0/2 |
|
198 | scanning paths [ ] 0/2 | |
198 | scanning paths [==================> ] 1/2 |
|
199 | scanning paths [==================> ] 1/2 | |
199 | getting files [========> ] 1/4 |
|
200 | getting files [========> ] 1/4 | |
200 | getting files [==================> ] 2/4 |
|
201 | getting files [==================> ] 2/4 | |
201 | getting files [============================> ] 3/4 |
|
202 | getting files [============================> ] 3/4 | |
202 | getting files [======================================>] 4/4 |
|
203 | getting files [======================================>] 4/4 | |
203 |
|
204 | |||
204 | converting [=================> ] 3/7 |
|
205 | converting [=================> ] 3/7 | |
205 | scanning paths [ ] 0/1 |
|
206 | scanning paths [ ] 0/1 | |
206 | getting files [======================================>] 1/1 |
|
207 | getting files [======================================>] 1/1 | |
207 |
|
208 | |||
208 | converting [=======================> ] 4/7 |
|
209 | converting [=======================> ] 4/7 | |
209 | scanning paths [ ] 0/1 |
|
210 | scanning paths [ ] 0/1 | |
210 | getting files [======================================>] 1/1 |
|
211 | getting files [======================================>] 1/1 | |
211 |
|
212 | |||
212 | converting [=============================> ] 5/7 |
|
213 | converting [=============================> ] 5/7 | |
213 | scanning paths [ ] 0/3 |
|
214 | scanning paths [ ] 0/3 | |
214 | scanning paths [===========> ] 1/3 |
|
215 | scanning paths [===========> ] 1/3 | |
215 | scanning paths [========================> ] 2/3 |
|
216 | scanning paths [========================> ] 2/3 | |
216 | getting files [===> ] 1/8 |
|
217 | getting files [===> ] 1/8 | |
217 | getting files [========> ] 2/8 |
|
218 | getting files [========> ] 2/8 | |
218 | getting files [=============> ] 3/8 |
|
219 | getting files [=============> ] 3/8 | |
219 | getting files [==================> ] 4/8 |
|
220 | getting files [==================> ] 4/8 | |
220 | getting files [=======================> ] 5/8 |
|
221 | getting files [=======================> ] 5/8 | |
221 | getting files [============================> ] 6/8 |
|
222 | getting files [============================> ] 6/8 | |
222 | getting files [=================================> ] 7/8 |
|
223 | getting files [=================================> ] 7/8 | |
223 | getting files [======================================>] 8/8 |
|
224 | getting files [======================================>] 8/8 | |
224 |
|
225 | |||
225 | converting [===================================> ] 6/7 |
|
226 | converting [===================================> ] 6/7 | |
226 | scanning paths [ ] 0/1 |
|
227 | scanning paths [ ] 0/1 | |
227 | getting files [===> ] 1/8 |
|
228 | getting files [===> ] 1/8 | |
228 | getting files [========> ] 2/8 |
|
229 | getting files [========> ] 2/8 | |
229 | getting files [=============> ] 3/8 |
|
230 | getting files [=============> ] 3/8 | |
230 | getting files [==================> ] 4/8 |
|
231 | getting files [==================> ] 4/8 | |
231 | getting files [=======================> ] 5/8 |
|
232 | getting files [=======================> ] 5/8 | |
232 | getting files [============================> ] 6/8 |
|
233 | getting files [============================> ] 6/8 | |
233 | getting files [=================================> ] 7/8 |
|
234 | getting files [=================================> ] 7/8 | |
234 | getting files [======================================>] 8/8 |
|
235 | getting files [======================================>] 8/8 | |
235 |
|
236 | |||
236 | initializing destination hg-progress repository |
|
237 | initializing destination hg-progress repository | |
237 | scanning source... |
|
238 | scanning source... | |
238 | sorting... |
|
239 | sorting... | |
239 | converting... |
|
240 | converting... | |
240 | 6 initial |
|
241 | 6 initial | |
241 | 5 clobber symlink |
|
242 | 5 clobber symlink | |
242 | 4 clobber1 |
|
243 | 4 clobber1 | |
243 | 3 clobber2 |
|
244 | 3 clobber2 | |
244 | 2 adddb |
|
245 | 2 adddb | |
245 | 1 branch |
|
246 | 1 branch | |
246 | 0 clobberdir |
|
247 | 0 clobberdir | |
247 |
|
248 |
@@ -1,142 +1,143 b'' | |||||
1 |
|
1 | |||
2 | $ cat > loop.py <<EOF |
|
2 | $ cat > loop.py <<EOF | |
3 | > from mercurial import commands |
|
3 | > from mercurial import commands | |
4 | > |
|
4 | > | |
5 | > def loop(ui, loops, **opts): |
|
5 | > def loop(ui, loops, **opts): | |
6 | > loops = int(loops) |
|
6 | > loops = int(loops) | |
7 | > total = None |
|
7 | > total = None | |
8 | > if loops >= 0: |
|
8 | > if loops >= 0: | |
9 | > total = loops |
|
9 | > total = loops | |
10 | > if opts.get('total', None): |
|
10 | > if opts.get('total', None): | |
11 | > total = int(opts.get('total')) |
|
11 | > total = int(opts.get('total')) | |
12 | > loops = abs(loops) |
|
12 | > loops = abs(loops) | |
13 | > |
|
13 | > | |
14 | > for i in range(loops): |
|
14 | > for i in range(loops): | |
15 | > ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total) |
|
15 | > ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total) | |
16 | > ui.progress('loop', None, 'loop.done', 'loopnum', total) |
|
16 | > ui.progress('loop', None, 'loop.done', 'loopnum', total) | |
17 | > |
|
17 | > | |
18 | > commands.norepo += " loop" |
|
18 | > commands.norepo += " loop" | |
19 | > |
|
19 | > | |
20 | > cmdtable = { |
|
20 | > cmdtable = { | |
21 | > "loop": (loop, [('', 'total', '', 'override for total')], |
|
21 | > "loop": (loop, [('', 'total', '', 'override for total')], | |
22 | > 'hg loop LOOPS'), |
|
22 | > 'hg loop LOOPS'), | |
23 | > } |
|
23 | > } | |
24 | > EOF |
|
24 | > EOF | |
25 |
|
25 | |||
26 | $ echo "[extensions]" >> $HGRCPATH |
|
26 | $ echo "[extensions]" >> $HGRCPATH | |
27 | $ echo "progress=" >> $HGRCPATH |
|
27 | $ echo "progress=" >> $HGRCPATH | |
28 | $ echo "loop=`pwd`/loop.py" >> $HGRCPATH |
|
28 | $ echo "loop=`pwd`/loop.py" >> $HGRCPATH | |
29 | $ echo "[progress]" >> $HGRCPATH |
|
29 | $ echo "[progress]" >> $HGRCPATH | |
|
30 | $ echo "format = topic bar number" >> $HGRCPATH | |||
30 | $ echo "assume-tty=1" >> $HGRCPATH |
|
31 | $ echo "assume-tty=1" >> $HGRCPATH | |
31 | $ echo "width=60" >> $HGRCPATH |
|
32 | $ echo "width=60" >> $HGRCPATH | |
32 |
|
33 | |||
33 | test default params, display nothing because of delay |
|
34 | test default params, display nothing because of delay | |
34 |
|
35 | |||
35 | $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py |
|
36 | $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py | |
36 |
|
37 | |||
37 | $ echo "delay=0" >> $HGRCPATH |
|
38 | $ echo "delay=0" >> $HGRCPATH | |
38 | $ echo "refresh=0" >> $HGRCPATH |
|
39 | $ echo "refresh=0" >> $HGRCPATH | |
39 |
|
40 | |||
40 | test with delay=0, refresh=0 |
|
41 | test with delay=0, refresh=0 | |
41 |
|
42 | |||
42 | $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py |
|
43 | $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py | |
43 |
|
44 | |||
44 | loop [ ] 0/3 |
|
45 | loop [ ] 0/3 | |
45 | loop [===============> ] 1/3 |
|
46 | loop [===============> ] 1/3 | |
46 | loop [===============================> ] 2/3 |
|
47 | loop [===============================> ] 2/3 | |
47 | \r (esc) |
|
48 | \r (esc) | |
48 |
|
49 | |||
49 | test refresh is taken in account |
|
50 | test refresh is taken in account | |
50 |
|
51 | |||
51 | $ hg -y --config progress.refresh=100 loop 3 2>&1 | $TESTDIR/filtercr.py |
|
52 | $ hg -y --config progress.refresh=100 loop 3 2>&1 | $TESTDIR/filtercr.py | |
52 |
|
53 | |||
53 |
|
54 | |||
54 | test format options 1 |
|
55 | test format options 1 | |
55 |
|
56 | |||
56 | $ hg -y --config 'progress.format=number topic item+2' loop 2 2>&1 \ |
|
57 | $ hg -y --config 'progress.format=number topic item+2' loop 2 2>&1 \ | |
57 | > | $TESTDIR/filtercr.py |
|
58 | > | $TESTDIR/filtercr.py | |
58 |
|
59 | |||
59 | 0/2 loop lo |
|
60 | 0/2 loop lo | |
60 | 1/2 loop lo |
|
61 | 1/2 loop lo | |
61 | \r (esc) |
|
62 | \r (esc) | |
62 |
|
63 | |||
63 | test format options 2 |
|
64 | test format options 2 | |
64 |
|
65 | |||
65 | $ hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 \ |
|
66 | $ hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 \ | |
66 | > | $TESTDIR/filtercr.py |
|
67 | > | $TESTDIR/filtercr.py | |
67 |
|
68 | |||
68 | 0/2 p.0 [ ] |
|
69 | 0/2 p.0 [ ] | |
69 | 1/2 p.1 [=======================> ] |
|
70 | 1/2 p.1 [=======================> ] | |
70 | \r (esc) |
|
71 | \r (esc) | |
71 |
|
72 | |||
72 | test format options and indeterminate progress |
|
73 | test format options and indeterminate progress | |
73 |
|
74 | |||
74 | $ hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 \ |
|
75 | $ hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 \ | |
75 | > | $TESTDIR/filtercr.py |
|
76 | > | $TESTDIR/filtercr.py | |
76 |
|
77 | |||
77 | 0 loop.0 [ <=> ] |
|
78 | 0 loop.0 [ <=> ] | |
78 | 1 loop.1 [ <=> ] |
|
79 | 1 loop.1 [ <=> ] | |
79 | \r (esc) |
|
80 | \r (esc) | |
80 |
|
81 | |||
81 | make sure things don't fall over if count > total |
|
82 | make sure things don't fall over if count > total | |
82 |
|
83 | |||
83 | $ hg -y loop --total 4 6 2>&1 | $TESTDIR/filtercr.py |
|
84 | $ hg -y loop --total 4 6 2>&1 | $TESTDIR/filtercr.py | |
84 |
|
85 | |||
85 | loop [ ] 0/4 |
|
86 | loop [ ] 0/4 | |
86 | loop [===========> ] 1/4 |
|
87 | loop [===========> ] 1/4 | |
87 | loop [=======================> ] 2/4 |
|
88 | loop [=======================> ] 2/4 | |
88 | loop [===================================> ] 3/4 |
|
89 | loop [===================================> ] 3/4 | |
89 | loop [===============================================>] 4/4 |
|
90 | loop [===============================================>] 4/4 | |
90 | loop [ <=> ] 5/4 |
|
91 | loop [ <=> ] 5/4 | |
91 | \r (esc) |
|
92 | \r (esc) | |
92 |
|
93 | |||
93 | test immediate progress completion |
|
94 | test immediate progress completion | |
94 |
|
95 | |||
95 | $ hg -y loop 0 2>&1 | $TESTDIR/filtercr.py |
|
96 | $ hg -y loop 0 2>&1 | $TESTDIR/filtercr.py | |
96 |
|
97 | |||
97 |
|
98 | |||
98 | test delay time estimates |
|
99 | test delay time estimates | |
99 |
|
100 | |||
100 | $ cat > mocktime.py <<EOF |
|
101 | $ cat > mocktime.py <<EOF | |
101 | > import os |
|
102 | > import os | |
102 | > import time |
|
103 | > import time | |
103 | > |
|
104 | > | |
104 | > class mocktime(object): |
|
105 | > class mocktime(object): | |
105 | > def __init__(self, increment): |
|
106 | > def __init__(self, increment): | |
106 | > self.time = 0 |
|
107 | > self.time = 0 | |
107 | > self.increment = increment |
|
108 | > self.increment = increment | |
108 | > def __call__(self): |
|
109 | > def __call__(self): | |
109 | > self.time += self.increment |
|
110 | > self.time += self.increment | |
110 | > return self.time |
|
111 | > return self.time | |
111 | > |
|
112 | > | |
112 | > def uisetup(ui): |
|
113 | > def uisetup(ui): | |
113 | > time.time = mocktime(int(os.environ.get('MOCKTIME', '11'))) |
|
114 | > time.time = mocktime(int(os.environ.get('MOCKTIME', '11'))) | |
114 | > EOF |
|
115 | > EOF | |
115 |
|
116 | |||
116 | $ echo "[extensions]" > $HGRCPATH |
|
117 | $ echo "[extensions]" > $HGRCPATH | |
117 | $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH |
|
118 | $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH | |
118 | $ echo "progress=" >> $HGRCPATH |
|
119 | $ echo "progress=" >> $HGRCPATH | |
119 | $ echo "loop=`pwd`/loop.py" >> $HGRCPATH |
|
120 | $ echo "loop=`pwd`/loop.py" >> $HGRCPATH | |
120 | $ echo "[progress]" >> $HGRCPATH |
|
121 | $ echo "[progress]" >> $HGRCPATH | |
121 | $ echo "assume-tty=1" >> $HGRCPATH |
|
122 | $ echo "assume-tty=1" >> $HGRCPATH | |
122 | $ echo "delay=25" >> $HGRCPATH |
|
123 | $ echo "delay=25" >> $HGRCPATH | |
123 | $ echo "width=60" >> $HGRCPATH |
|
124 | $ echo "width=60" >> $HGRCPATH | |
124 |
|
125 | |||
125 | $ hg -y loop 8 2>&1 | python $TESTDIR/filtercr.py |
|
126 | $ hg -y loop 8 2>&1 | python $TESTDIR/filtercr.py | |
126 |
|
127 | |||
127 | loop [=========> ] 2/8 1m07s |
|
128 | loop [=========> ] 2/8 1m07s | |
128 | loop [===============> ] 3/8 56s |
|
129 | loop [===============> ] 3/8 56s | |
129 | loop [=====================> ] 4/8 45s |
|
130 | loop [=====================> ] 4/8 45s | |
130 | loop [==========================> ] 5/8 34s |
|
131 | loop [==========================> ] 5/8 34s | |
131 | loop [================================> ] 6/8 23s |
|
132 | loop [================================> ] 6/8 23s | |
132 | loop [=====================================> ] 7/8 12s |
|
133 | loop [=====================================> ] 7/8 12s | |
133 | \r (esc) |
|
134 | \r (esc) | |
134 |
|
135 | |||
135 | $ MOCKTIME=10000 hg -y loop 4 2>&1 | python $TESTDIR/filtercr.py |
|
136 | $ MOCKTIME=10000 hg -y loop 4 2>&1 | python $TESTDIR/filtercr.py | |
136 |
|
137 | |||
137 | loop [ ] 0/4 |
|
138 | loop [ ] 0/4 | |
138 | loop [=========> ] 1/4 8h21m |
|
139 | loop [=========> ] 1/4 8h21m | |
139 | loop [====================> ] 2/4 5h34m |
|
140 | loop [====================> ] 2/4 5h34m | |
140 | loop [==============================> ] 3/4 2h47m |
|
141 | loop [==============================> ] 3/4 2h47m | |
141 | \r (esc) |
|
142 | \r (esc) | |
142 |
|
143 |
@@ -1,414 +1,415 b'' | |||||
1 | Create test repository: |
|
1 | Create test repository: | |
2 |
|
2 | |||
3 | $ hg init repo |
|
3 | $ hg init repo | |
4 | $ cd repo |
|
4 | $ cd repo | |
5 | $ echo x1 > x.txt |
|
5 | $ echo x1 > x.txt | |
6 |
|
6 | |||
7 | $ hg init foo |
|
7 | $ hg init foo | |
8 | $ cd foo |
|
8 | $ cd foo | |
9 | $ echo y1 > y.txt |
|
9 | $ echo y1 > y.txt | |
10 |
|
10 | |||
11 | $ hg init bar |
|
11 | $ hg init bar | |
12 | $ cd bar |
|
12 | $ cd bar | |
13 | $ echo z1 > z.txt |
|
13 | $ echo z1 > z.txt | |
14 |
|
14 | |||
15 | $ cd .. |
|
15 | $ cd .. | |
16 | $ echo 'bar = bar' > .hgsub |
|
16 | $ echo 'bar = bar' > .hgsub | |
17 |
|
17 | |||
18 | $ cd .. |
|
18 | $ cd .. | |
19 | $ echo 'foo = foo' > .hgsub |
|
19 | $ echo 'foo = foo' > .hgsub | |
20 |
|
20 | |||
21 | Add files --- .hgsub files must go first to trigger subrepos: |
|
21 | Add files --- .hgsub files must go first to trigger subrepos: | |
22 |
|
22 | |||
23 | $ hg add -S .hgsub |
|
23 | $ hg add -S .hgsub | |
24 | $ hg add -S foo/.hgsub |
|
24 | $ hg add -S foo/.hgsub | |
25 | $ hg add -S foo/bar |
|
25 | $ hg add -S foo/bar | |
26 | adding foo/bar/z.txt |
|
26 | adding foo/bar/z.txt | |
27 | $ hg add -S |
|
27 | $ hg add -S | |
28 | adding x.txt |
|
28 | adding x.txt | |
29 | adding foo/y.txt |
|
29 | adding foo/y.txt | |
30 |
|
30 | |||
31 | Test recursive status without committing anything: |
|
31 | Test recursive status without committing anything: | |
32 |
|
32 | |||
33 | $ hg status -S |
|
33 | $ hg status -S | |
34 | A .hgsub |
|
34 | A .hgsub | |
35 | A foo/.hgsub |
|
35 | A foo/.hgsub | |
36 | A foo/bar/z.txt |
|
36 | A foo/bar/z.txt | |
37 | A foo/y.txt |
|
37 | A foo/y.txt | |
38 | A x.txt |
|
38 | A x.txt | |
39 |
|
39 | |||
40 | Test recursive diff without committing anything: |
|
40 | Test recursive diff without committing anything: | |
41 |
|
41 | |||
42 | $ hg diff --nodates -S foo |
|
42 | $ hg diff --nodates -S foo | |
43 | diff -r 000000000000 foo/.hgsub |
|
43 | diff -r 000000000000 foo/.hgsub | |
44 | --- /dev/null |
|
44 | --- /dev/null | |
45 | +++ b/foo/.hgsub |
|
45 | +++ b/foo/.hgsub | |
46 | @@ -0,0 +1,1 @@ |
|
46 | @@ -0,0 +1,1 @@ | |
47 | +bar = bar |
|
47 | +bar = bar | |
48 | diff -r 000000000000 foo/y.txt |
|
48 | diff -r 000000000000 foo/y.txt | |
49 | --- /dev/null |
|
49 | --- /dev/null | |
50 | +++ b/foo/y.txt |
|
50 | +++ b/foo/y.txt | |
51 | @@ -0,0 +1,1 @@ |
|
51 | @@ -0,0 +1,1 @@ | |
52 | +y1 |
|
52 | +y1 | |
53 | diff -r 000000000000 foo/bar/z.txt |
|
53 | diff -r 000000000000 foo/bar/z.txt | |
54 | --- /dev/null |
|
54 | --- /dev/null | |
55 | +++ b/foo/bar/z.txt |
|
55 | +++ b/foo/bar/z.txt | |
56 | @@ -0,0 +1,1 @@ |
|
56 | @@ -0,0 +1,1 @@ | |
57 | +z1 |
|
57 | +z1 | |
58 |
|
58 | |||
59 | Commits: |
|
59 | Commits: | |
60 |
|
60 | |||
61 | $ hg commit -m 0-0-0 |
|
61 | $ hg commit -m 0-0-0 | |
62 | committing subrepository foo |
|
62 | committing subrepository foo | |
63 | committing subrepository foo/bar |
|
63 | committing subrepository foo/bar | |
64 |
|
64 | |||
65 | $ cd foo |
|
65 | $ cd foo | |
66 | $ echo y2 >> y.txt |
|
66 | $ echo y2 >> y.txt | |
67 | $ hg commit -m 0-1-0 |
|
67 | $ hg commit -m 0-1-0 | |
68 |
|
68 | |||
69 | $ cd bar |
|
69 | $ cd bar | |
70 | $ echo z2 >> z.txt |
|
70 | $ echo z2 >> z.txt | |
71 | $ hg commit -m 0-1-1 |
|
71 | $ hg commit -m 0-1-1 | |
72 |
|
72 | |||
73 | $ cd .. |
|
73 | $ cd .. | |
74 | $ hg commit -m 0-2-1 |
|
74 | $ hg commit -m 0-2-1 | |
75 | committing subrepository bar |
|
75 | committing subrepository bar | |
76 |
|
76 | |||
77 | $ cd .. |
|
77 | $ cd .. | |
78 | $ hg commit -m 1-2-1 |
|
78 | $ hg commit -m 1-2-1 | |
79 | committing subrepository foo |
|
79 | committing subrepository foo | |
80 |
|
80 | |||
81 | Change working directory: |
|
81 | Change working directory: | |
82 |
|
82 | |||
83 | $ echo y3 >> foo/y.txt |
|
83 | $ echo y3 >> foo/y.txt | |
84 | $ echo z3 >> foo/bar/z.txt |
|
84 | $ echo z3 >> foo/bar/z.txt | |
85 | $ hg status -S |
|
85 | $ hg status -S | |
86 | M foo/bar/z.txt |
|
86 | M foo/bar/z.txt | |
87 | M foo/y.txt |
|
87 | M foo/y.txt | |
88 | $ hg diff --nodates -S |
|
88 | $ hg diff --nodates -S | |
89 | diff -r d254738c5f5e foo/y.txt |
|
89 | diff -r d254738c5f5e foo/y.txt | |
90 | --- a/foo/y.txt |
|
90 | --- a/foo/y.txt | |
91 | +++ b/foo/y.txt |
|
91 | +++ b/foo/y.txt | |
92 | @@ -1,2 +1,3 @@ |
|
92 | @@ -1,2 +1,3 @@ | |
93 | y1 |
|
93 | y1 | |
94 | y2 |
|
94 | y2 | |
95 | +y3 |
|
95 | +y3 | |
96 | diff -r 9647f22de499 foo/bar/z.txt |
|
96 | diff -r 9647f22de499 foo/bar/z.txt | |
97 | --- a/foo/bar/z.txt |
|
97 | --- a/foo/bar/z.txt | |
98 | +++ b/foo/bar/z.txt |
|
98 | +++ b/foo/bar/z.txt | |
99 | @@ -1,2 +1,3 @@ |
|
99 | @@ -1,2 +1,3 @@ | |
100 | z1 |
|
100 | z1 | |
101 | z2 |
|
101 | z2 | |
102 | +z3 |
|
102 | +z3 | |
103 |
|
103 | |||
104 | Status call crossing repository boundaries: |
|
104 | Status call crossing repository boundaries: | |
105 |
|
105 | |||
106 | $ hg status -S foo/bar/z.txt |
|
106 | $ hg status -S foo/bar/z.txt | |
107 | M foo/bar/z.txt |
|
107 | M foo/bar/z.txt | |
108 | $ hg status -S -I 'foo/?.txt' |
|
108 | $ hg status -S -I 'foo/?.txt' | |
109 | M foo/y.txt |
|
109 | M foo/y.txt | |
110 | $ hg status -S -I '**/?.txt' |
|
110 | $ hg status -S -I '**/?.txt' | |
111 | M foo/bar/z.txt |
|
111 | M foo/bar/z.txt | |
112 | M foo/y.txt |
|
112 | M foo/y.txt | |
113 | $ hg diff --nodates -S -I '**/?.txt' |
|
113 | $ hg diff --nodates -S -I '**/?.txt' | |
114 | diff -r d254738c5f5e foo/y.txt |
|
114 | diff -r d254738c5f5e foo/y.txt | |
115 | --- a/foo/y.txt |
|
115 | --- a/foo/y.txt | |
116 | +++ b/foo/y.txt |
|
116 | +++ b/foo/y.txt | |
117 | @@ -1,2 +1,3 @@ |
|
117 | @@ -1,2 +1,3 @@ | |
118 | y1 |
|
118 | y1 | |
119 | y2 |
|
119 | y2 | |
120 | +y3 |
|
120 | +y3 | |
121 | diff -r 9647f22de499 foo/bar/z.txt |
|
121 | diff -r 9647f22de499 foo/bar/z.txt | |
122 | --- a/foo/bar/z.txt |
|
122 | --- a/foo/bar/z.txt | |
123 | +++ b/foo/bar/z.txt |
|
123 | +++ b/foo/bar/z.txt | |
124 | @@ -1,2 +1,3 @@ |
|
124 | @@ -1,2 +1,3 @@ | |
125 | z1 |
|
125 | z1 | |
126 | z2 |
|
126 | z2 | |
127 | +z3 |
|
127 | +z3 | |
128 |
|
128 | |||
129 | Status from within a subdirectory: |
|
129 | Status from within a subdirectory: | |
130 |
|
130 | |||
131 | $ mkdir dir |
|
131 | $ mkdir dir | |
132 | $ cd dir |
|
132 | $ cd dir | |
133 | $ echo a1 > a.txt |
|
133 | $ echo a1 > a.txt | |
134 | $ hg status -S |
|
134 | $ hg status -S | |
135 | M foo/bar/z.txt |
|
135 | M foo/bar/z.txt | |
136 | M foo/y.txt |
|
136 | M foo/y.txt | |
137 | ? dir/a.txt |
|
137 | ? dir/a.txt | |
138 | $ hg diff --nodates -S |
|
138 | $ hg diff --nodates -S | |
139 | diff -r d254738c5f5e foo/y.txt |
|
139 | diff -r d254738c5f5e foo/y.txt | |
140 | --- a/foo/y.txt |
|
140 | --- a/foo/y.txt | |
141 | +++ b/foo/y.txt |
|
141 | +++ b/foo/y.txt | |
142 | @@ -1,2 +1,3 @@ |
|
142 | @@ -1,2 +1,3 @@ | |
143 | y1 |
|
143 | y1 | |
144 | y2 |
|
144 | y2 | |
145 | +y3 |
|
145 | +y3 | |
146 | diff -r 9647f22de499 foo/bar/z.txt |
|
146 | diff -r 9647f22de499 foo/bar/z.txt | |
147 | --- a/foo/bar/z.txt |
|
147 | --- a/foo/bar/z.txt | |
148 | +++ b/foo/bar/z.txt |
|
148 | +++ b/foo/bar/z.txt | |
149 | @@ -1,2 +1,3 @@ |
|
149 | @@ -1,2 +1,3 @@ | |
150 | z1 |
|
150 | z1 | |
151 | z2 |
|
151 | z2 | |
152 | +z3 |
|
152 | +z3 | |
153 |
|
153 | |||
154 | Status with relative path: |
|
154 | Status with relative path: | |
155 |
|
155 | |||
156 | $ hg status -S .. |
|
156 | $ hg status -S .. | |
157 | M ../foo/bar/z.txt |
|
157 | M ../foo/bar/z.txt | |
158 | M ../foo/y.txt |
|
158 | M ../foo/y.txt | |
159 | ? a.txt |
|
159 | ? a.txt | |
160 | $ hg diff --nodates -S .. |
|
160 | $ hg diff --nodates -S .. | |
161 | diff -r d254738c5f5e foo/y.txt |
|
161 | diff -r d254738c5f5e foo/y.txt | |
162 | --- a/foo/y.txt |
|
162 | --- a/foo/y.txt | |
163 | +++ b/foo/y.txt |
|
163 | +++ b/foo/y.txt | |
164 | @@ -1,2 +1,3 @@ |
|
164 | @@ -1,2 +1,3 @@ | |
165 | y1 |
|
165 | y1 | |
166 | y2 |
|
166 | y2 | |
167 | +y3 |
|
167 | +y3 | |
168 | diff -r 9647f22de499 foo/bar/z.txt |
|
168 | diff -r 9647f22de499 foo/bar/z.txt | |
169 | --- a/foo/bar/z.txt |
|
169 | --- a/foo/bar/z.txt | |
170 | +++ b/foo/bar/z.txt |
|
170 | +++ b/foo/bar/z.txt | |
171 | @@ -1,2 +1,3 @@ |
|
171 | @@ -1,2 +1,3 @@ | |
172 | z1 |
|
172 | z1 | |
173 | z2 |
|
173 | z2 | |
174 | +z3 |
|
174 | +z3 | |
175 | $ cd .. |
|
175 | $ cd .. | |
176 |
|
176 | |||
177 | Cleanup and final commit: |
|
177 | Cleanup and final commit: | |
178 |
|
178 | |||
179 | $ rm -r dir |
|
179 | $ rm -r dir | |
180 | $ hg commit -m 2-3-2 |
|
180 | $ hg commit -m 2-3-2 | |
181 | committing subrepository foo |
|
181 | committing subrepository foo | |
182 | committing subrepository foo/bar |
|
182 | committing subrepository foo/bar | |
183 |
|
183 | |||
184 | Log with the relationships between repo and its subrepo: |
|
184 | Log with the relationships between repo and its subrepo: | |
185 |
|
185 | |||
186 | $ hg log --template '{rev}:{node|short} {desc}\n' |
|
186 | $ hg log --template '{rev}:{node|short} {desc}\n' | |
187 | 2:1326fa26d0c0 2-3-2 |
|
187 | 2:1326fa26d0c0 2-3-2 | |
188 | 1:4b3c9ff4f66b 1-2-1 |
|
188 | 1:4b3c9ff4f66b 1-2-1 | |
189 | 0:23376cbba0d8 0-0-0 |
|
189 | 0:23376cbba0d8 0-0-0 | |
190 |
|
190 | |||
191 | $ hg -R foo log --template '{rev}:{node|short} {desc}\n' |
|
191 | $ hg -R foo log --template '{rev}:{node|short} {desc}\n' | |
192 | 3:65903cebad86 2-3-2 |
|
192 | 3:65903cebad86 2-3-2 | |
193 | 2:d254738c5f5e 0-2-1 |
|
193 | 2:d254738c5f5e 0-2-1 | |
194 | 1:8629ce7dcc39 0-1-0 |
|
194 | 1:8629ce7dcc39 0-1-0 | |
195 | 0:af048e97ade2 0-0-0 |
|
195 | 0:af048e97ade2 0-0-0 | |
196 |
|
196 | |||
197 | $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' |
|
197 | $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' | |
198 | 2:31ecbdafd357 2-3-2 |
|
198 | 2:31ecbdafd357 2-3-2 | |
199 | 1:9647f22de499 0-1-1 |
|
199 | 1:9647f22de499 0-1-1 | |
200 | 0:4904098473f9 0-0-0 |
|
200 | 0:4904098473f9 0-0-0 | |
201 |
|
201 | |||
202 | Status between revisions: |
|
202 | Status between revisions: | |
203 |
|
203 | |||
204 | $ hg status -S |
|
204 | $ hg status -S | |
205 | $ hg status -S --rev 0:1 |
|
205 | $ hg status -S --rev 0:1 | |
206 | M .hgsubstate |
|
206 | M .hgsubstate | |
207 | M foo/.hgsubstate |
|
207 | M foo/.hgsubstate | |
208 | M foo/bar/z.txt |
|
208 | M foo/bar/z.txt | |
209 | M foo/y.txt |
|
209 | M foo/y.txt | |
210 | $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 |
|
210 | $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 | |
211 | diff -r af048e97ade2 -r d254738c5f5e foo/y.txt |
|
211 | diff -r af048e97ade2 -r d254738c5f5e foo/y.txt | |
212 | --- a/foo/y.txt |
|
212 | --- a/foo/y.txt | |
213 | +++ b/foo/y.txt |
|
213 | +++ b/foo/y.txt | |
214 | @@ -1,1 +1,2 @@ |
|
214 | @@ -1,1 +1,2 @@ | |
215 | y1 |
|
215 | y1 | |
216 | +y2 |
|
216 | +y2 | |
217 | diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt |
|
217 | diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt | |
218 | --- a/foo/bar/z.txt |
|
218 | --- a/foo/bar/z.txt | |
219 | +++ b/foo/bar/z.txt |
|
219 | +++ b/foo/bar/z.txt | |
220 | @@ -1,1 +1,2 @@ |
|
220 | @@ -1,1 +1,2 @@ | |
221 | z1 |
|
221 | z1 | |
222 | +z2 |
|
222 | +z2 | |
223 |
|
223 | |||
224 | Enable progress extension for archive tests: |
|
224 | Enable progress extension for archive tests: | |
225 |
|
225 | |||
226 | $ cp $HGRCPATH $HGRCPATH.no-progress |
|
226 | $ cp $HGRCPATH $HGRCPATH.no-progress | |
227 | $ cat >> $HGRCPATH <<EOF |
|
227 | $ cat >> $HGRCPATH <<EOF | |
228 | > [extensions] |
|
228 | > [extensions] | |
229 | > progress = |
|
229 | > progress = | |
230 | > [progress] |
|
230 | > [progress] | |
231 | > assume-tty = 1 |
|
231 | > assume-tty = 1 | |
232 | > delay = 0 |
|
232 | > delay = 0 | |
|
233 | > format = topic bar number | |||
233 | > refresh = 0 |
|
234 | > refresh = 0 | |
234 | > width = 60 |
|
235 | > width = 60 | |
235 | > EOF |
|
236 | > EOF | |
236 |
|
237 | |||
237 | Test archiving to a directory tree (the doubled lines in the output |
|
238 | Test archiving to a directory tree (the doubled lines in the output | |
238 | only show up in the test output, not in real usage): |
|
239 | only show up in the test output, not in real usage): | |
239 |
|
240 | |||
240 | $ hg archive --subrepos ../archive 2>&1 | $TESTDIR/filtercr.py |
|
241 | $ hg archive --subrepos ../archive 2>&1 | $TESTDIR/filtercr.py | |
241 |
|
242 | |||
242 | archiving [ ] 0/3 |
|
243 | archiving [ ] 0/3 | |
243 | archiving [ ] 0/3 |
|
244 | archiving [ ] 0/3 | |
244 | archiving [=============> ] 1/3 |
|
245 | archiving [=============> ] 1/3 | |
245 | archiving [=============> ] 1/3 |
|
246 | archiving [=============> ] 1/3 | |
246 | archiving [===========================> ] 2/3 |
|
247 | archiving [===========================> ] 2/3 | |
247 | archiving [===========================> ] 2/3 |
|
248 | archiving [===========================> ] 2/3 | |
248 | archiving [==========================================>] 3/3 |
|
249 | archiving [==========================================>] 3/3 | |
249 | archiving [==========================================>] 3/3 |
|
250 | archiving [==========================================>] 3/3 | |
250 |
|
251 | |||
251 | archiving (foo) [ ] 0/3 |
|
252 | archiving (foo) [ ] 0/3 | |
252 | archiving (foo) [ ] 0/3 |
|
253 | archiving (foo) [ ] 0/3 | |
253 | archiving (foo) [===========> ] 1/3 |
|
254 | archiving (foo) [===========> ] 1/3 | |
254 | archiving (foo) [===========> ] 1/3 |
|
255 | archiving (foo) [===========> ] 1/3 | |
255 | archiving (foo) [=======================> ] 2/3 |
|
256 | archiving (foo) [=======================> ] 2/3 | |
256 | archiving (foo) [=======================> ] 2/3 |
|
257 | archiving (foo) [=======================> ] 2/3 | |
257 | archiving (foo) [====================================>] 3/3 |
|
258 | archiving (foo) [====================================>] 3/3 | |
258 | archiving (foo) [====================================>] 3/3 |
|
259 | archiving (foo) [====================================>] 3/3 | |
259 |
|
260 | |||
260 | archiving (foo/bar) [ ] 0/1 |
|
261 | archiving (foo/bar) [ ] 0/1 | |
261 | archiving (foo/bar) [ ] 0/1 |
|
262 | archiving (foo/bar) [ ] 0/1 | |
262 | archiving (foo/bar) [================================>] 1/1 |
|
263 | archiving (foo/bar) [================================>] 1/1 | |
263 | archiving (foo/bar) [================================>] 1/1 |
|
264 | archiving (foo/bar) [================================>] 1/1 | |
264 | \r (esc) |
|
265 | \r (esc) | |
265 | $ find ../archive | sort |
|
266 | $ find ../archive | sort | |
266 | ../archive |
|
267 | ../archive | |
267 | ../archive/.hg_archival.txt |
|
268 | ../archive/.hg_archival.txt | |
268 | ../archive/.hgsub |
|
269 | ../archive/.hgsub | |
269 | ../archive/.hgsubstate |
|
270 | ../archive/.hgsubstate | |
270 | ../archive/foo |
|
271 | ../archive/foo | |
271 | ../archive/foo/.hgsub |
|
272 | ../archive/foo/.hgsub | |
272 | ../archive/foo/.hgsubstate |
|
273 | ../archive/foo/.hgsubstate | |
273 | ../archive/foo/bar |
|
274 | ../archive/foo/bar | |
274 | ../archive/foo/bar/z.txt |
|
275 | ../archive/foo/bar/z.txt | |
275 | ../archive/foo/y.txt |
|
276 | ../archive/foo/y.txt | |
276 | ../archive/x.txt |
|
277 | ../archive/x.txt | |
277 |
|
278 | |||
278 | Test archiving to zip file (unzip output is unstable): |
|
279 | Test archiving to zip file (unzip output is unstable): | |
279 |
|
280 | |||
280 | $ hg archive --subrepos ../archive.zip 2>&1 | $TESTDIR/filtercr.py |
|
281 | $ hg archive --subrepos ../archive.zip 2>&1 | $TESTDIR/filtercr.py | |
281 |
|
282 | |||
282 | archiving [ ] 0/3 |
|
283 | archiving [ ] 0/3 | |
283 | archiving [ ] 0/3 |
|
284 | archiving [ ] 0/3 | |
284 | archiving [=============> ] 1/3 |
|
285 | archiving [=============> ] 1/3 | |
285 | archiving [=============> ] 1/3 |
|
286 | archiving [=============> ] 1/3 | |
286 | archiving [===========================> ] 2/3 |
|
287 | archiving [===========================> ] 2/3 | |
287 | archiving [===========================> ] 2/3 |
|
288 | archiving [===========================> ] 2/3 | |
288 | archiving [==========================================>] 3/3 |
|
289 | archiving [==========================================>] 3/3 | |
289 | archiving [==========================================>] 3/3 |
|
290 | archiving [==========================================>] 3/3 | |
290 |
|
291 | |||
291 | archiving (foo) [ ] 0/3 |
|
292 | archiving (foo) [ ] 0/3 | |
292 | archiving (foo) [ ] 0/3 |
|
293 | archiving (foo) [ ] 0/3 | |
293 | archiving (foo) [===========> ] 1/3 |
|
294 | archiving (foo) [===========> ] 1/3 | |
294 | archiving (foo) [===========> ] 1/3 |
|
295 | archiving (foo) [===========> ] 1/3 | |
295 | archiving (foo) [=======================> ] 2/3 |
|
296 | archiving (foo) [=======================> ] 2/3 | |
296 | archiving (foo) [=======================> ] 2/3 |
|
297 | archiving (foo) [=======================> ] 2/3 | |
297 | archiving (foo) [====================================>] 3/3 |
|
298 | archiving (foo) [====================================>] 3/3 | |
298 | archiving (foo) [====================================>] 3/3 |
|
299 | archiving (foo) [====================================>] 3/3 | |
299 |
|
300 | |||
300 | archiving (foo/bar) [ ] 0/1 |
|
301 | archiving (foo/bar) [ ] 0/1 | |
301 | archiving (foo/bar) [ ] 0/1 |
|
302 | archiving (foo/bar) [ ] 0/1 | |
302 | archiving (foo/bar) [================================>] 1/1 |
|
303 | archiving (foo/bar) [================================>] 1/1 | |
303 | archiving (foo/bar) [================================>] 1/1 |
|
304 | archiving (foo/bar) [================================>] 1/1 | |
304 | \r (esc) |
|
305 | \r (esc) | |
305 |
|
306 | |||
306 | Disable progress extension and cleanup: |
|
307 | Disable progress extension and cleanup: | |
307 |
|
308 | |||
308 | $ mv $HGRCPATH.no-progress $HGRCPATH |
|
309 | $ mv $HGRCPATH.no-progress $HGRCPATH | |
309 |
|
310 | |||
310 | Clone and test outgoing: |
|
311 | Clone and test outgoing: | |
311 |
|
312 | |||
312 | $ cd .. |
|
313 | $ cd .. | |
313 | $ hg clone repo repo2 |
|
314 | $ hg clone repo repo2 | |
314 | updating to branch default |
|
315 | updating to branch default | |
315 | pulling subrepo foo from $TESTTMP/repo/foo |
|
316 | pulling subrepo foo from $TESTTMP/repo/foo | |
316 | requesting all changes |
|
317 | requesting all changes | |
317 | adding changesets |
|
318 | adding changesets | |
318 | adding manifests |
|
319 | adding manifests | |
319 | adding file changes |
|
320 | adding file changes | |
320 | added 4 changesets with 7 changes to 3 files |
|
321 | added 4 changesets with 7 changes to 3 files | |
321 | pulling subrepo foo/bar from $TESTTMP/repo/foo/bar |
|
322 | pulling subrepo foo/bar from $TESTTMP/repo/foo/bar | |
322 | requesting all changes |
|
323 | requesting all changes | |
323 | adding changesets |
|
324 | adding changesets | |
324 | adding manifests |
|
325 | adding manifests | |
325 | adding file changes |
|
326 | adding file changes | |
326 | added 3 changesets with 3 changes to 1 files |
|
327 | added 3 changesets with 3 changes to 1 files | |
327 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
328 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
328 | $ cd repo2 |
|
329 | $ cd repo2 | |
329 | $ hg outgoing -S |
|
330 | $ hg outgoing -S | |
330 | comparing with $TESTTMP/repo |
|
331 | comparing with $TESTTMP/repo | |
331 | searching for changes |
|
332 | searching for changes | |
332 | no changes found |
|
333 | no changes found | |
333 | comparing with $TESTTMP/repo/foo |
|
334 | comparing with $TESTTMP/repo/foo | |
334 | searching for changes |
|
335 | searching for changes | |
335 | no changes found |
|
336 | no changes found | |
336 | comparing with $TESTTMP/repo/foo/bar |
|
337 | comparing with $TESTTMP/repo/foo/bar | |
337 | searching for changes |
|
338 | searching for changes | |
338 | no changes found |
|
339 | no changes found | |
339 | [1] |
|
340 | [1] | |
340 |
|
341 | |||
341 | Make nested change: |
|
342 | Make nested change: | |
342 |
|
343 | |||
343 | $ echo y4 >> foo/y.txt |
|
344 | $ echo y4 >> foo/y.txt | |
344 | $ hg diff --nodates -S |
|
345 | $ hg diff --nodates -S | |
345 | diff -r 65903cebad86 foo/y.txt |
|
346 | diff -r 65903cebad86 foo/y.txt | |
346 | --- a/foo/y.txt |
|
347 | --- a/foo/y.txt | |
347 | +++ b/foo/y.txt |
|
348 | +++ b/foo/y.txt | |
348 | @@ -1,3 +1,4 @@ |
|
349 | @@ -1,3 +1,4 @@ | |
349 | y1 |
|
350 | y1 | |
350 | y2 |
|
351 | y2 | |
351 | y3 |
|
352 | y3 | |
352 | +y4 |
|
353 | +y4 | |
353 | $ hg commit -m 3-4-2 |
|
354 | $ hg commit -m 3-4-2 | |
354 | committing subrepository foo |
|
355 | committing subrepository foo | |
355 | $ hg outgoing -S |
|
356 | $ hg outgoing -S | |
356 | comparing with $TESTTMP/repo |
|
357 | comparing with $TESTTMP/repo | |
357 | searching for changes |
|
358 | searching for changes | |
358 | changeset: 3:2655b8ecc4ee |
|
359 | changeset: 3:2655b8ecc4ee | |
359 | tag: tip |
|
360 | tag: tip | |
360 | user: test |
|
361 | user: test | |
361 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
362 | date: Thu Jan 01 00:00:00 1970 +0000 | |
362 | summary: 3-4-2 |
|
363 | summary: 3-4-2 | |
363 |
|
364 | |||
364 | comparing with $TESTTMP/repo/foo |
|
365 | comparing with $TESTTMP/repo/foo | |
365 | searching for changes |
|
366 | searching for changes | |
366 | changeset: 4:e96193d6cb36 |
|
367 | changeset: 4:e96193d6cb36 | |
367 | tag: tip |
|
368 | tag: tip | |
368 | user: test |
|
369 | user: test | |
369 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
370 | date: Thu Jan 01 00:00:00 1970 +0000 | |
370 | summary: 3-4-2 |
|
371 | summary: 3-4-2 | |
371 |
|
372 | |||
372 | comparing with $TESTTMP/repo/foo/bar |
|
373 | comparing with $TESTTMP/repo/foo/bar | |
373 | searching for changes |
|
374 | searching for changes | |
374 | no changes found |
|
375 | no changes found | |
375 |
|
376 | |||
376 |
|
377 | |||
377 | Switch to original repo and setup default path: |
|
378 | Switch to original repo and setup default path: | |
378 |
|
379 | |||
379 | $ cd ../repo |
|
380 | $ cd ../repo | |
380 | $ echo '[paths]' >> .hg/hgrc |
|
381 | $ echo '[paths]' >> .hg/hgrc | |
381 | $ echo 'default = ../repo2' >> .hg/hgrc |
|
382 | $ echo 'default = ../repo2' >> .hg/hgrc | |
382 |
|
383 | |||
383 | Test incoming: |
|
384 | Test incoming: | |
384 |
|
385 | |||
385 | $ hg incoming -S |
|
386 | $ hg incoming -S | |
386 | comparing with $TESTTMP/repo2 |
|
387 | comparing with $TESTTMP/repo2 | |
387 | searching for changes |
|
388 | searching for changes | |
388 | changeset: 3:2655b8ecc4ee |
|
389 | changeset: 3:2655b8ecc4ee | |
389 | tag: tip |
|
390 | tag: tip | |
390 | user: test |
|
391 | user: test | |
391 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
392 | date: Thu Jan 01 00:00:00 1970 +0000 | |
392 | summary: 3-4-2 |
|
393 | summary: 3-4-2 | |
393 |
|
394 | |||
394 | comparing with $TESTTMP/repo2/foo |
|
395 | comparing with $TESTTMP/repo2/foo | |
395 | searching for changes |
|
396 | searching for changes | |
396 | changeset: 4:e96193d6cb36 |
|
397 | changeset: 4:e96193d6cb36 | |
397 | tag: tip |
|
398 | tag: tip | |
398 | user: test |
|
399 | user: test | |
399 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
400 | date: Thu Jan 01 00:00:00 1970 +0000 | |
400 | summary: 3-4-2 |
|
401 | summary: 3-4-2 | |
401 |
|
402 | |||
402 | comparing with $TESTTMP/repo2/foo/bar |
|
403 | comparing with $TESTTMP/repo2/foo/bar | |
403 | searching for changes |
|
404 | searching for changes | |
404 | no changes found |
|
405 | no changes found | |
405 |
|
406 | |||
406 | $ hg incoming -S --bundle incoming.hg |
|
407 | $ hg incoming -S --bundle incoming.hg | |
407 | abort: cannot combine --bundle and --subrepos |
|
408 | abort: cannot combine --bundle and --subrepos | |
408 | [255] |
|
409 | [255] | |
409 |
|
410 | |||
410 | Test missing subrepo: |
|
411 | Test missing subrepo: | |
411 |
|
412 | |||
412 | $ rm -r foo |
|
413 | $ rm -r foo | |
413 | $ hg status -S |
|
414 | $ hg status -S | |
414 | warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" |
|
415 | warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" |
General Comments 0
You need to be logged in to leave comments.
Login now