##// END OF EJS Templates
tests: remove lines that enable progress extension...
timeless -
r28597:cd34bf29 default
parent child Browse files
Show More
@@ -1,362 +1,360 b''
1 #require serve
1 #require serve
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo foo>foo
5 $ echo foo>foo
6 $ hg commit -Am 1 -d '1 0'
6 $ hg commit -Am 1 -d '1 0'
7 adding foo
7 adding foo
8 $ echo bar>bar
8 $ echo bar>bar
9 $ hg commit -Am 2 -d '2 0'
9 $ hg commit -Am 2 -d '2 0'
10 adding bar
10 adding bar
11 $ mkdir baz
11 $ mkdir baz
12 $ echo bletch>baz/bletch
12 $ echo bletch>baz/bletch
13 $ hg commit -Am 3 -d '1000000000 0'
13 $ hg commit -Am 3 -d '1000000000 0'
14 adding baz/bletch
14 adding baz/bletch
15 $ hg init subrepo
15 $ hg init subrepo
16 $ touch subrepo/sub
16 $ touch subrepo/sub
17 $ hg -q -R subrepo ci -Am "init subrepo"
17 $ hg -q -R subrepo ci -Am "init subrepo"
18 $ echo "subrepo = subrepo" > .hgsub
18 $ echo "subrepo = subrepo" > .hgsub
19 $ hg add .hgsub
19 $ hg add .hgsub
20 $ hg ci -m "add subrepo"
20 $ hg ci -m "add subrepo"
21 $ echo "[web]" >> .hg/hgrc
21 $ echo "[web]" >> .hg/hgrc
22 $ echo "name = test-archive" >> .hg/hgrc
22 $ echo "name = test-archive" >> .hg/hgrc
23 $ echo "archivesubrepos = True" >> .hg/hgrc
23 $ echo "archivesubrepos = True" >> .hg/hgrc
24 $ cp .hg/hgrc .hg/hgrc-base
24 $ cp .hg/hgrc .hg/hgrc-base
25 > test_archtype() {
25 > test_archtype() {
26 > echo "allow_archive = $1" >> .hg/hgrc
26 > echo "allow_archive = $1" >> .hg/hgrc
27 > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
27 > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
28 > cat hg.pid >> $DAEMON_PIDS
28 > cat hg.pid >> $DAEMON_PIDS
29 > echo % $1 allowed should give 200
29 > echo % $1 allowed should give 200
30 > get-with-headers.py localhost:$HGPORT "archive/tip.$2" | head -n 1
30 > get-with-headers.py localhost:$HGPORT "archive/tip.$2" | head -n 1
31 > echo % $3 and $4 disallowed should both give 403
31 > echo % $3 and $4 disallowed should both give 403
32 > get-with-headers.py localhost:$HGPORT "archive/tip.$3" | head -n 1
32 > get-with-headers.py localhost:$HGPORT "archive/tip.$3" | head -n 1
33 > get-with-headers.py localhost:$HGPORT "archive/tip.$4" | head -n 1
33 > get-with-headers.py localhost:$HGPORT "archive/tip.$4" | head -n 1
34 > killdaemons.py
34 > killdaemons.py
35 > cat errors.log
35 > cat errors.log
36 > cp .hg/hgrc-base .hg/hgrc
36 > cp .hg/hgrc-base .hg/hgrc
37 > }
37 > }
38
38
39 check http return codes
39 check http return codes
40
40
41 $ test_archtype gz tar.gz tar.bz2 zip
41 $ test_archtype gz tar.gz tar.bz2 zip
42 % gz allowed should give 200
42 % gz allowed should give 200
43 200 Script output follows
43 200 Script output follows
44 % tar.bz2 and zip disallowed should both give 403
44 % tar.bz2 and zip disallowed should both give 403
45 403 Archive type not allowed: bz2
45 403 Archive type not allowed: bz2
46 403 Archive type not allowed: zip
46 403 Archive type not allowed: zip
47 $ test_archtype bz2 tar.bz2 zip tar.gz
47 $ test_archtype bz2 tar.bz2 zip tar.gz
48 % bz2 allowed should give 200
48 % bz2 allowed should give 200
49 200 Script output follows
49 200 Script output follows
50 % zip and tar.gz disallowed should both give 403
50 % zip and tar.gz disallowed should both give 403
51 403 Archive type not allowed: zip
51 403 Archive type not allowed: zip
52 403 Archive type not allowed: gz
52 403 Archive type not allowed: gz
53 $ test_archtype zip zip tar.gz tar.bz2
53 $ test_archtype zip zip tar.gz tar.bz2
54 % zip allowed should give 200
54 % zip allowed should give 200
55 200 Script output follows
55 200 Script output follows
56 % tar.gz and tar.bz2 disallowed should both give 403
56 % tar.gz and tar.bz2 disallowed should both give 403
57 403 Archive type not allowed: gz
57 403 Archive type not allowed: gz
58 403 Archive type not allowed: bz2
58 403 Archive type not allowed: bz2
59
59
60 $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc
60 $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc
61 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
61 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
62 $ cat hg.pid >> $DAEMON_PIDS
62 $ cat hg.pid >> $DAEMON_PIDS
63
63
64 invalid arch type should give 404
64 invalid arch type should give 404
65
65
66 $ get-with-headers.py localhost:$HGPORT "archive/tip.invalid" | head -n 1
66 $ get-with-headers.py localhost:$HGPORT "archive/tip.invalid" | head -n 1
67 404 Unsupported archive type: None
67 404 Unsupported archive type: None
68
68
69 $ TIP=`hg id -v | cut -f1 -d' '`
69 $ TIP=`hg id -v | cut -f1 -d' '`
70 $ QTIP=`hg id -q`
70 $ QTIP=`hg id -q`
71 $ cat > getarchive.py <<EOF
71 $ cat > getarchive.py <<EOF
72 > import os, sys, urllib2
72 > import os, sys, urllib2
73 > try:
73 > try:
74 > # Set stdout to binary mode for win32 platforms
74 > # Set stdout to binary mode for win32 platforms
75 > import msvcrt
75 > import msvcrt
76 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
76 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
77 > except ImportError:
77 > except ImportError:
78 > pass
78 > pass
79 > if len(sys.argv) <= 3:
79 > if len(sys.argv) <= 3:
80 > node, archive = sys.argv[1:]
80 > node, archive = sys.argv[1:]
81 > requeststr = 'cmd=archive;node=%s;type=%s' % (node, archive)
81 > requeststr = 'cmd=archive;node=%s;type=%s' % (node, archive)
82 > else:
82 > else:
83 > node, archive, file = sys.argv[1:]
83 > node, archive, file = sys.argv[1:]
84 > requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file)
84 > requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file)
85 > try:
85 > try:
86 > f = urllib2.urlopen('http://127.0.0.1:%s/?%s'
86 > f = urllib2.urlopen('http://127.0.0.1:%s/?%s'
87 > % (os.environ['HGPORT'], requeststr))
87 > % (os.environ['HGPORT'], requeststr))
88 > sys.stdout.write(f.read())
88 > sys.stdout.write(f.read())
89 > except urllib2.HTTPError, e:
89 > except urllib2.HTTPError, e:
90 > sys.stderr.write(str(e) + '\n')
90 > sys.stderr.write(str(e) + '\n')
91 > EOF
91 > EOF
92 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
92 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
93 test-archive-1701ef1f1510/.hg_archival.txt
93 test-archive-1701ef1f1510/.hg_archival.txt
94 test-archive-1701ef1f1510/.hgsub
94 test-archive-1701ef1f1510/.hgsub
95 test-archive-1701ef1f1510/.hgsubstate
95 test-archive-1701ef1f1510/.hgsubstate
96 test-archive-1701ef1f1510/bar
96 test-archive-1701ef1f1510/bar
97 test-archive-1701ef1f1510/baz/bletch
97 test-archive-1701ef1f1510/baz/bletch
98 test-archive-1701ef1f1510/foo
98 test-archive-1701ef1f1510/foo
99 test-archive-1701ef1f1510/subrepo/sub
99 test-archive-1701ef1f1510/subrepo/sub
100 $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
100 $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
101 test-archive-1701ef1f1510/.hg_archival.txt
101 test-archive-1701ef1f1510/.hg_archival.txt
102 test-archive-1701ef1f1510/.hgsub
102 test-archive-1701ef1f1510/.hgsub
103 test-archive-1701ef1f1510/.hgsubstate
103 test-archive-1701ef1f1510/.hgsubstate
104 test-archive-1701ef1f1510/bar
104 test-archive-1701ef1f1510/bar
105 test-archive-1701ef1f1510/baz/bletch
105 test-archive-1701ef1f1510/baz/bletch
106 test-archive-1701ef1f1510/foo
106 test-archive-1701ef1f1510/foo
107 test-archive-1701ef1f1510/subrepo/sub
107 test-archive-1701ef1f1510/subrepo/sub
108 $ python getarchive.py "$TIP" zip > archive.zip
108 $ python getarchive.py "$TIP" zip > archive.zip
109 $ unzip -t archive.zip
109 $ unzip -t archive.zip
110 Archive: archive.zip
110 Archive: archive.zip
111 testing: test-archive-1701ef1f1510/.hg_archival.txt OK
111 testing: test-archive-1701ef1f1510/.hg_archival.txt OK
112 testing: test-archive-1701ef1f1510/.hgsub OK
112 testing: test-archive-1701ef1f1510/.hgsub OK
113 testing: test-archive-1701ef1f1510/.hgsubstate OK
113 testing: test-archive-1701ef1f1510/.hgsubstate OK
114 testing: test-archive-1701ef1f1510/bar OK
114 testing: test-archive-1701ef1f1510/bar OK
115 testing: test-archive-1701ef1f1510/baz/bletch OK
115 testing: test-archive-1701ef1f1510/baz/bletch OK
116 testing: test-archive-1701ef1f1510/foo OK
116 testing: test-archive-1701ef1f1510/foo OK
117 testing: test-archive-1701ef1f1510/subrepo/sub OK
117 testing: test-archive-1701ef1f1510/subrepo/sub OK
118 No errors detected in compressed data of archive.zip.
118 No errors detected in compressed data of archive.zip.
119
119
120 test that we can download single directories and files
120 test that we can download single directories and files
121
121
122 $ python getarchive.py "$TIP" gz baz | gunzip | tar tf - 2>/dev/null
122 $ python getarchive.py "$TIP" gz baz | gunzip | tar tf - 2>/dev/null
123 test-archive-1701ef1f1510/baz/bletch
123 test-archive-1701ef1f1510/baz/bletch
124 $ python getarchive.py "$TIP" gz foo | gunzip | tar tf - 2>/dev/null
124 $ python getarchive.py "$TIP" gz foo | gunzip | tar tf - 2>/dev/null
125 test-archive-1701ef1f1510/foo
125 test-archive-1701ef1f1510/foo
126
126
127 test that we detect file patterns that match no files
127 test that we detect file patterns that match no files
128
128
129 $ python getarchive.py "$TIP" gz foobar
129 $ python getarchive.py "$TIP" gz foobar
130 HTTP Error 404: file(s) not found: foobar
130 HTTP Error 404: file(s) not found: foobar
131
131
132 test that we reject unsafe patterns
132 test that we reject unsafe patterns
133
133
134 $ python getarchive.py "$TIP" gz relre:baz
134 $ python getarchive.py "$TIP" gz relre:baz
135 HTTP Error 404: file(s) not found: relre:baz
135 HTTP Error 404: file(s) not found: relre:baz
136
136
137 $ killdaemons.py
137 $ killdaemons.py
138
138
139 $ hg archive -t tar test.tar
139 $ hg archive -t tar test.tar
140 $ tar tf test.tar
140 $ tar tf test.tar
141 test/.hg_archival.txt
141 test/.hg_archival.txt
142 test/.hgsub
142 test/.hgsub
143 test/.hgsubstate
143 test/.hgsubstate
144 test/bar
144 test/bar
145 test/baz/bletch
145 test/baz/bletch
146 test/foo
146 test/foo
147
147
148 $ hg archive --debug -t tbz2 -X baz test.tar.bz2 --config progress.debug=true
148 $ hg archive --debug -t tbz2 -X baz test.tar.bz2 --config progress.debug=true
149 archiving: 0/4 files (0.00%)
149 archiving: 0/4 files (0.00%)
150 archiving: .hgsub 1/4 files (25.00%)
150 archiving: .hgsub 1/4 files (25.00%)
151 archiving: .hgsubstate 2/4 files (50.00%)
151 archiving: .hgsubstate 2/4 files (50.00%)
152 archiving: bar 3/4 files (75.00%)
152 archiving: bar 3/4 files (75.00%)
153 archiving: foo 4/4 files (100.00%)
153 archiving: foo 4/4 files (100.00%)
154 $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
154 $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
155 test/.hg_archival.txt
155 test/.hg_archival.txt
156 test/.hgsub
156 test/.hgsub
157 test/.hgsubstate
157 test/.hgsubstate
158 test/bar
158 test/bar
159 test/foo
159 test/foo
160
160
161 $ hg archive -t tgz -p %b-%h test-%h.tar.gz
161 $ hg archive -t tgz -p %b-%h test-%h.tar.gz
162 $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
162 $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
163 test-1701ef1f1510/.hg_archival.txt
163 test-1701ef1f1510/.hg_archival.txt
164 test-1701ef1f1510/.hgsub
164 test-1701ef1f1510/.hgsub
165 test-1701ef1f1510/.hgsubstate
165 test-1701ef1f1510/.hgsubstate
166 test-1701ef1f1510/bar
166 test-1701ef1f1510/bar
167 test-1701ef1f1510/baz/bletch
167 test-1701ef1f1510/baz/bletch
168 test-1701ef1f1510/foo
168 test-1701ef1f1510/foo
169
169
170 $ hg archive autodetected_test.tar
170 $ hg archive autodetected_test.tar
171 $ tar tf autodetected_test.tar
171 $ tar tf autodetected_test.tar
172 autodetected_test/.hg_archival.txt
172 autodetected_test/.hg_archival.txt
173 autodetected_test/.hgsub
173 autodetected_test/.hgsub
174 autodetected_test/.hgsubstate
174 autodetected_test/.hgsubstate
175 autodetected_test/bar
175 autodetected_test/bar
176 autodetected_test/baz/bletch
176 autodetected_test/baz/bletch
177 autodetected_test/foo
177 autodetected_test/foo
178
178
179 The '-t' should override autodetection
179 The '-t' should override autodetection
180
180
181 $ hg archive -t tar autodetect_override_test.zip
181 $ hg archive -t tar autodetect_override_test.zip
182 $ tar tf autodetect_override_test.zip
182 $ tar tf autodetect_override_test.zip
183 autodetect_override_test.zip/.hg_archival.txt
183 autodetect_override_test.zip/.hg_archival.txt
184 autodetect_override_test.zip/.hgsub
184 autodetect_override_test.zip/.hgsub
185 autodetect_override_test.zip/.hgsubstate
185 autodetect_override_test.zip/.hgsubstate
186 autodetect_override_test.zip/bar
186 autodetect_override_test.zip/bar
187 autodetect_override_test.zip/baz/bletch
187 autodetect_override_test.zip/baz/bletch
188 autodetect_override_test.zip/foo
188 autodetect_override_test.zip/foo
189
189
190 $ for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do
190 $ for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do
191 > hg archive auto_test.$ext
191 > hg archive auto_test.$ext
192 > if [ -d auto_test.$ext ]; then
192 > if [ -d auto_test.$ext ]; then
193 > echo "extension $ext was not autodetected."
193 > echo "extension $ext was not autodetected."
194 > fi
194 > fi
195 > done
195 > done
196
196
197 $ cat > md5comp.py <<EOF
197 $ cat > md5comp.py <<EOF
198 > try:
198 > try:
199 > from hashlib import md5
199 > from hashlib import md5
200 > except ImportError:
200 > except ImportError:
201 > from md5 import md5
201 > from md5 import md5
202 > import sys
202 > import sys
203 > f1, f2 = sys.argv[1:3]
203 > f1, f2 = sys.argv[1:3]
204 > h1 = md5(file(f1, 'rb').read()).hexdigest()
204 > h1 = md5(file(f1, 'rb').read()).hexdigest()
205 > h2 = md5(file(f2, 'rb').read()).hexdigest()
205 > h2 = md5(file(f2, 'rb').read()).hexdigest()
206 > print h1 == h2 or "md5 differ: " + repr((h1, h2))
206 > print h1 == h2 or "md5 differ: " + repr((h1, h2))
207 > EOF
207 > EOF
208
208
209 archive name is stored in the archive, so create similar archives and
209 archive name is stored in the archive, so create similar archives and
210 rename them afterwards.
210 rename them afterwards.
211
211
212 $ hg archive -t tgz tip.tar.gz
212 $ hg archive -t tgz tip.tar.gz
213 $ mv tip.tar.gz tip1.tar.gz
213 $ mv tip.tar.gz tip1.tar.gz
214 $ sleep 1
214 $ sleep 1
215 $ hg archive -t tgz tip.tar.gz
215 $ hg archive -t tgz tip.tar.gz
216 $ mv tip.tar.gz tip2.tar.gz
216 $ mv tip.tar.gz tip2.tar.gz
217 $ python md5comp.py tip1.tar.gz tip2.tar.gz
217 $ python md5comp.py tip1.tar.gz tip2.tar.gz
218 True
218 True
219
219
220 $ hg archive -t zip -p /illegal test.zip
220 $ hg archive -t zip -p /illegal test.zip
221 abort: archive prefix contains illegal components
221 abort: archive prefix contains illegal components
222 [255]
222 [255]
223 $ hg archive -t zip -p very/../bad test.zip
223 $ hg archive -t zip -p very/../bad test.zip
224
224
225 $ hg archive --config ui.archivemeta=false -t zip -r 2 test.zip
225 $ hg archive --config ui.archivemeta=false -t zip -r 2 test.zip
226 $ unzip -t test.zip
226 $ unzip -t test.zip
227 Archive: test.zip
227 Archive: test.zip
228 testing: test/bar OK
228 testing: test/bar OK
229 testing: test/baz/bletch OK
229 testing: test/baz/bletch OK
230 testing: test/foo OK
230 testing: test/foo OK
231 No errors detected in compressed data of test.zip.
231 No errors detected in compressed data of test.zip.
232
232
233 $ hg archive -t tar - | tar tf - 2>/dev/null
233 $ hg archive -t tar - | tar tf - 2>/dev/null
234 test-1701ef1f1510/.hg_archival.txt
234 test-1701ef1f1510/.hg_archival.txt
235 test-1701ef1f1510/.hgsub
235 test-1701ef1f1510/.hgsub
236 test-1701ef1f1510/.hgsubstate
236 test-1701ef1f1510/.hgsubstate
237 test-1701ef1f1510/bar
237 test-1701ef1f1510/bar
238 test-1701ef1f1510/baz/bletch
238 test-1701ef1f1510/baz/bletch
239 test-1701ef1f1510/foo
239 test-1701ef1f1510/foo
240
240
241 $ hg archive -r 0 -t tar rev-%r.tar
241 $ hg archive -r 0 -t tar rev-%r.tar
242 $ [ -f rev-0.tar ]
242 $ [ -f rev-0.tar ]
243
243
244 test .hg_archival.txt
244 test .hg_archival.txt
245
245
246 $ hg archive ../test-tags
246 $ hg archive ../test-tags
247 $ cat ../test-tags/.hg_archival.txt
247 $ cat ../test-tags/.hg_archival.txt
248 repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
248 repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
249 node: 1701ef1f151069b8747038e93b5186bb43a47504
249 node: 1701ef1f151069b8747038e93b5186bb43a47504
250 branch: default
250 branch: default
251 latesttag: null
251 latesttag: null
252 latesttagdistance: 4
252 latesttagdistance: 4
253 changessincelatesttag: 4
253 changessincelatesttag: 4
254 $ hg tag -r 2 mytag
254 $ hg tag -r 2 mytag
255 $ hg tag -r 2 anothertag
255 $ hg tag -r 2 anothertag
256 $ hg archive -r 2 ../test-lasttag
256 $ hg archive -r 2 ../test-lasttag
257 $ cat ../test-lasttag/.hg_archival.txt
257 $ cat ../test-lasttag/.hg_archival.txt
258 repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
258 repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
259 node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
259 node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
260 branch: default
260 branch: default
261 tag: anothertag
261 tag: anothertag
262 tag: mytag
262 tag: mytag
263
263
264 $ hg archive -t bogus test.bogus
264 $ hg archive -t bogus test.bogus
265 abort: unknown archive type 'bogus'
265 abort: unknown archive type 'bogus'
266 [255]
266 [255]
267
267
268 enable progress extension:
268 enable progress extension:
269
269
270 $ cp $HGRCPATH $HGRCPATH.no-progress
270 $ cp $HGRCPATH $HGRCPATH.no-progress
271 $ cat >> $HGRCPATH <<EOF
271 $ cat >> $HGRCPATH <<EOF
272 > [extensions]
273 > progress =
274 > [progress]
272 > [progress]
275 > assume-tty = 1
273 > assume-tty = 1
276 > format = topic bar number
274 > format = topic bar number
277 > delay = 0
275 > delay = 0
278 > refresh = 0
276 > refresh = 0
279 > width = 60
277 > width = 60
280 > EOF
278 > EOF
281
279
282 $ hg archive ../with-progress
280 $ hg archive ../with-progress
283 \r (no-eol) (esc)
281 \r (no-eol) (esc)
284 archiving [ ] 0/6\r (no-eol) (esc)
282 archiving [ ] 0/6\r (no-eol) (esc)
285 archiving [======> ] 1/6\r (no-eol) (esc)
283 archiving [======> ] 1/6\r (no-eol) (esc)
286 archiving [=============> ] 2/6\r (no-eol) (esc)
284 archiving [=============> ] 2/6\r (no-eol) (esc)
287 archiving [====================> ] 3/6\r (no-eol) (esc)
285 archiving [====================> ] 3/6\r (no-eol) (esc)
288 archiving [===========================> ] 4/6\r (no-eol) (esc)
286 archiving [===========================> ] 4/6\r (no-eol) (esc)
289 archiving [==================================> ] 5/6\r (no-eol) (esc)
287 archiving [==================================> ] 5/6\r (no-eol) (esc)
290 archiving [==========================================>] 6/6\r (no-eol) (esc)
288 archiving [==========================================>] 6/6\r (no-eol) (esc)
291 \r (no-eol) (esc)
289 \r (no-eol) (esc)
292
290
293 cleanup after progress extension test:
291 cleanup after progress extension test:
294
292
295 $ cp $HGRCPATH.no-progress $HGRCPATH
293 $ cp $HGRCPATH.no-progress $HGRCPATH
296
294
297 server errors
295 server errors
298
296
299 $ cat errors.log
297 $ cat errors.log
300
298
301 empty repo
299 empty repo
302
300
303 $ hg init ../empty
301 $ hg init ../empty
304 $ cd ../empty
302 $ cd ../empty
305 $ hg archive ../test-empty
303 $ hg archive ../test-empty
306 abort: no working directory: please specify a revision
304 abort: no working directory: please specify a revision
307 [255]
305 [255]
308
306
309 old file -- date clamped to 1980
307 old file -- date clamped to 1980
310
308
311 $ touch -t 197501010000 old
309 $ touch -t 197501010000 old
312 $ hg add old
310 $ hg add old
313 $ hg commit -m old
311 $ hg commit -m old
314 $ hg archive ../old.zip
312 $ hg archive ../old.zip
315 $ unzip -l ../old.zip
313 $ unzip -l ../old.zip
316 Archive: ../old.zip
314 Archive: ../old.zip
317 \s*Length.* (re)
315 \s*Length.* (re)
318 *-----* (glob)
316 *-----* (glob)
319 *172*80*00:00*old/.hg_archival.txt (glob)
317 *172*80*00:00*old/.hg_archival.txt (glob)
320 *0*80*00:00*old/old (glob)
318 *0*80*00:00*old/old (glob)
321 *-----* (glob)
319 *-----* (glob)
322 \s*172\s+2 files (re)
320 \s*172\s+2 files (re)
323
321
324 show an error when a provided pattern matches no files
322 show an error when a provided pattern matches no files
325
323
326 $ hg archive -I file_that_does_not_exist.foo ../empty.zip
324 $ hg archive -I file_that_does_not_exist.foo ../empty.zip
327 abort: no files match the archive pattern
325 abort: no files match the archive pattern
328 [255]
326 [255]
329
327
330 $ hg archive -X * ../empty.zip
328 $ hg archive -X * ../empty.zip
331 abort: no files match the archive pattern
329 abort: no files match the archive pattern
332 [255]
330 [255]
333
331
334 $ cd ..
332 $ cd ..
335
333
336 issue3600: check whether "hg archive" can create archive files which
334 issue3600: check whether "hg archive" can create archive files which
337 are extracted with expected timestamp, even though TZ is not
335 are extracted with expected timestamp, even though TZ is not
338 configured as GMT.
336 configured as GMT.
339
337
340 $ mkdir issue3600
338 $ mkdir issue3600
341 $ cd issue3600
339 $ cd issue3600
342
340
343 $ hg init repo
341 $ hg init repo
344 $ echo a > repo/a
342 $ echo a > repo/a
345 $ hg -R repo add repo/a
343 $ hg -R repo add repo/a
346 $ hg -R repo commit -m '#0' -d '456789012 21600'
344 $ hg -R repo commit -m '#0' -d '456789012 21600'
347 $ cat > show_mtime.py <<EOF
345 $ cat > show_mtime.py <<EOF
348 > import sys, os
346 > import sys, os
349 > print int(os.stat(sys.argv[1]).st_mtime)
347 > print int(os.stat(sys.argv[1]).st_mtime)
350 > EOF
348 > EOF
351
349
352 $ hg -R repo archive --prefix tar-extracted archive.tar
350 $ hg -R repo archive --prefix tar-extracted archive.tar
353 $ (TZ=UTC-3; export TZ; tar xf archive.tar)
351 $ (TZ=UTC-3; export TZ; tar xf archive.tar)
354 $ python show_mtime.py tar-extracted/a
352 $ python show_mtime.py tar-extracted/a
355 456789012
353 456789012
356
354
357 $ hg -R repo archive --prefix zip-extracted archive.zip
355 $ hg -R repo archive --prefix zip-extracted archive.zip
358 $ (TZ=UTC-3; export TZ; unzip -q archive.zip)
356 $ (TZ=UTC-3; export TZ; unzip -q archive.zip)
359 $ python show_mtime.py zip-extracted/a
357 $ python show_mtime.py zip-extracted/a
360 456789012
358 456789012
361
359
362 $ cd ..
360 $ cd ..
@@ -1,247 +1,245 b''
1 #require svn svn-bindings
1 #require svn svn-bindings
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > convert =
5 > convert =
6 > EOF
6 > EOF
7
7
8 $ svnadmin create svn-repo
8 $ svnadmin create svn-repo
9 $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump"
9 $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump"
10 $ SVNREPOPATH=`pwd`/svn-repo
10 $ SVNREPOPATH=`pwd`/svn-repo
11 #if windows
11 #if windows
12 $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
12 $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
13 #else
13 #else
14 $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
14 $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
15 #endif
15 #endif
16
16
17 Convert trunk and branches
17 Convert trunk and branches
18
18
19 $ hg convert --datesort "$SVNREPOURL"/subproject A-hg
19 $ hg convert --datesort "$SVNREPOURL"/subproject A-hg
20 initializing destination A-hg repository
20 initializing destination A-hg repository
21 scanning source...
21 scanning source...
22 sorting...
22 sorting...
23 converting...
23 converting...
24 13 createtrunk
24 13 createtrunk
25 12 moved1
25 12 moved1
26 11 moved1
26 11 moved1
27 10 moved2
27 10 moved2
28 9 changeb and rm d2
28 9 changeb and rm d2
29 8 changeb and rm d2
29 8 changeb and rm d2
30 7 moved1again
30 7 moved1again
31 6 moved1again
31 6 moved1again
32 5 copyfilefrompast
32 5 copyfilefrompast
33 4 copydirfrompast
33 4 copydirfrompast
34 3 add d3
34 3 add d3
35 2 copy dir and remove subdir
35 2 copy dir and remove subdir
36 1 add d4old
36 1 add d4old
37 0 rename d4old into d4new
37 0 rename d4old into d4new
38
38
39 $ cd A-hg
39 $ cd A-hg
40 $ hg log -G --template '{rev} {desc|firstline} files: {files}\n'
40 $ hg log -G --template '{rev} {desc|firstline} files: {files}\n'
41 o 13 rename d4old into d4new files: d4new/g d4old/g
41 o 13 rename d4old into d4new files: d4new/g d4old/g
42 |
42 |
43 o 12 add d4old files: d4old/g
43 o 12 add d4old files: d4old/g
44 |
44 |
45 o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f
45 o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f
46 |
46 |
47 o 10 add d3 files: d3/d31/e d3/f
47 o 10 add d3 files: d3/d31/e d3/f
48 |
48 |
49 o 9 copydirfrompast files: d2/d
49 o 9 copydirfrompast files: d2/d
50 |
50 |
51 o 8 copyfilefrompast files: d
51 o 8 copyfilefrompast files: d
52 |
52 |
53 o 7 moved1again files: d1/b d1/c
53 o 7 moved1again files: d1/b d1/c
54 |
54 |
55 | o 6 moved1again files:
55 | o 6 moved1again files:
56 | |
56 | |
57 o | 5 changeb and rm d2 files: d1/b d2/d
57 o | 5 changeb and rm d2 files: d1/b d2/d
58 | |
58 | |
59 | o 4 changeb and rm d2 files: b
59 | o 4 changeb and rm d2 files: b
60 | |
60 | |
61 o | 3 moved2 files: d2/d
61 o | 3 moved2 files: d2/d
62 | |
62 | |
63 o | 2 moved1 files: d1/b d1/c
63 o | 2 moved1 files: d1/b d1/c
64 | |
64 | |
65 | o 1 moved1 files: b c
65 | o 1 moved1 files: b c
66 |
66 |
67 o 0 createtrunk files:
67 o 0 createtrunk files:
68
68
69
69
70 Check move copy records
70 Check move copy records
71
71
72 $ hg st --rev 12:13 --copies
72 $ hg st --rev 12:13 --copies
73 A d4new/g
73 A d4new/g
74 d4old/g
74 d4old/g
75 R d4old/g
75 R d4old/g
76
76
77 Check branches
77 Check branches
78
78
79 $ hg branches
79 $ hg branches
80 default 13:* (glob)
80 default 13:* (glob)
81 d1 6:* (glob)
81 d1 6:* (glob)
82 $ cd ..
82 $ cd ..
83
83
84 $ mkdir test-replace
84 $ mkdir test-replace
85 $ cd test-replace
85 $ cd test-replace
86 $ svnadmin create svn-repo
86 $ svnadmin create svn-repo
87 $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump"
87 $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump"
88
88
89 Convert files being replaced by directories
89 Convert files being replaced by directories
90
90
91 $ hg convert svn-repo hg-repo
91 $ hg convert svn-repo hg-repo
92 initializing destination hg-repo repository
92 initializing destination hg-repo repository
93 scanning source...
93 scanning source...
94 sorting...
94 sorting...
95 converting...
95 converting...
96 6 initial
96 6 initial
97 5 clobber symlink
97 5 clobber symlink
98 4 clobber1
98 4 clobber1
99 3 clobber2
99 3 clobber2
100 2 adddb
100 2 adddb
101 1 clobberdir
101 1 clobberdir
102 0 branch
102 0 branch
103
103
104 $ cd hg-repo
104 $ cd hg-repo
105
105
106 Manifest before
106 Manifest before
107
107
108 $ hg -v manifest -r 1
108 $ hg -v manifest -r 1
109 644 a
109 644 a
110 644 d/b
110 644 d/b
111 644 d2/a
111 644 d2/a
112 644 @ dlink
112 644 @ dlink
113 644 @ dlink2
113 644 @ dlink2
114 644 dlink3
114 644 dlink3
115
115
116 Manifest after clobber1
116 Manifest after clobber1
117
117
118 $ hg -v manifest -r 2
118 $ hg -v manifest -r 2
119 644 a/b
119 644 a/b
120 644 d/b
120 644 d/b
121 644 d2/a
121 644 d2/a
122 644 dlink/b
122 644 dlink/b
123 644 @ dlink2
123 644 @ dlink2
124 644 dlink3
124 644 dlink3
125
125
126 Manifest after clobber2
126 Manifest after clobber2
127
127
128 $ hg -v manifest -r 3
128 $ hg -v manifest -r 3
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 clobberdir
136 Manifest after clobberdir
137
137
138 $ hg -v manifest -r 6
138 $ hg -v manifest -r 6
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 d2/c
142 644 d2/c
143 644 dlink/b
143 644 dlink/b
144 644 @ dlink2
144 644 @ dlink2
145 644 @ dlink3
145 644 @ dlink3
146
146
147 Try updating
147 Try updating
148
148
149 $ hg up -qC default
149 $ hg up -qC default
150 $ cd ..
150 $ cd ..
151
151
152 Test convert progress bar
152 Test convert progress bar
153
153
154 $ cat >> $HGRCPATH <<EOF
154 $ cat >> $HGRCPATH <<EOF
155 > [extensions]
156 > progress =
157 > [progress]
155 > [progress]
158 > assume-tty = 1
156 > assume-tty = 1
159 > delay = 0
157 > delay = 0
160 > changedelay = 0
158 > changedelay = 0
161 > format = topic bar number
159 > format = topic bar number
162 > refresh = 0
160 > refresh = 0
163 > width = 60
161 > width = 60
164 > EOF
162 > EOF
165
163
166 $ hg convert svn-repo hg-progress
164 $ hg convert svn-repo hg-progress
167 \r (no-eol) (esc)
165 \r (no-eol) (esc)
168 scanning [=====> ] 1/7\r (no-eol) (esc)
166 scanning [=====> ] 1/7\r (no-eol) (esc)
169 scanning [===========> ] 2/7\r (no-eol) (esc)
167 scanning [===========> ] 2/7\r (no-eol) (esc)
170 scanning [=================> ] 3/7\r (no-eol) (esc)
168 scanning [=================> ] 3/7\r (no-eol) (esc)
171 scanning [========================> ] 4/7\r (no-eol) (esc)
169 scanning [========================> ] 4/7\r (no-eol) (esc)
172 scanning [==============================> ] 5/7\r (no-eol) (esc)
170 scanning [==============================> ] 5/7\r (no-eol) (esc)
173 scanning [====================================> ] 6/7\r (no-eol) (esc)
171 scanning [====================================> ] 6/7\r (no-eol) (esc)
174 scanning [===========================================>] 7/7\r (no-eol) (esc)
172 scanning [===========================================>] 7/7\r (no-eol) (esc)
175 \r (no-eol) (esc)
173 \r (no-eol) (esc)
176 \r (no-eol) (esc)
174 \r (no-eol) (esc)
177 converting [ ] 0/7\r (no-eol) (esc)
175 converting [ ] 0/7\r (no-eol) (esc)
178 getting files [=====> ] 1/6\r (no-eol) (esc)
176 getting files [=====> ] 1/6\r (no-eol) (esc)
179 getting files [============> ] 2/6\r (no-eol) (esc)
177 getting files [============> ] 2/6\r (no-eol) (esc)
180 getting files [==================> ] 3/6\r (no-eol) (esc)
178 getting files [==================> ] 3/6\r (no-eol) (esc)
181 getting files [=========================> ] 4/6\r (no-eol) (esc)
179 getting files [=========================> ] 4/6\r (no-eol) (esc)
182 getting files [===============================> ] 5/6\r (no-eol) (esc)
180 getting files [===============================> ] 5/6\r (no-eol) (esc)
183 getting files [======================================>] 6/6\r (no-eol) (esc)
181 getting files [======================================>] 6/6\r (no-eol) (esc)
184 \r (no-eol) (esc)
182 \r (no-eol) (esc)
185 \r (no-eol) (esc)
183 \r (no-eol) (esc)
186 converting [=====> ] 1/7\r (no-eol) (esc)
184 converting [=====> ] 1/7\r (no-eol) (esc)
187 scanning paths [ ] 0/1\r (no-eol) (esc)
185 scanning paths [ ] 0/1\r (no-eol) (esc)
188 getting files [======================================>] 1/1\r (no-eol) (esc)
186 getting files [======================================>] 1/1\r (no-eol) (esc)
189 \r (no-eol) (esc)
187 \r (no-eol) (esc)
190 \r (no-eol) (esc)
188 \r (no-eol) (esc)
191 converting [===========> ] 2/7\r (no-eol) (esc)
189 converting [===========> ] 2/7\r (no-eol) (esc)
192 scanning paths [ ] 0/2\r (no-eol) (esc)
190 scanning paths [ ] 0/2\r (no-eol) (esc)
193 scanning paths [==================> ] 1/2\r (no-eol) (esc)
191 scanning paths [==================> ] 1/2\r (no-eol) (esc)
194 getting files [========> ] 1/4\r (no-eol) (esc)
192 getting files [========> ] 1/4\r (no-eol) (esc)
195 getting files [==================> ] 2/4\r (no-eol) (esc)
193 getting files [==================> ] 2/4\r (no-eol) (esc)
196 getting files [============================> ] 3/4\r (no-eol) (esc)
194 getting files [============================> ] 3/4\r (no-eol) (esc)
197 getting files [======================================>] 4/4\r (no-eol) (esc)
195 getting files [======================================>] 4/4\r (no-eol) (esc)
198 \r (no-eol) (esc)
196 \r (no-eol) (esc)
199 \r (no-eol) (esc)
197 \r (no-eol) (esc)
200 converting [=================> ] 3/7\r (no-eol) (esc)
198 converting [=================> ] 3/7\r (no-eol) (esc)
201 scanning paths [ ] 0/1\r (no-eol) (esc)
199 scanning paths [ ] 0/1\r (no-eol) (esc)
202 getting files [======================================>] 1/1\r (no-eol) (esc)
200 getting files [======================================>] 1/1\r (no-eol) (esc)
203 \r (no-eol) (esc)
201 \r (no-eol) (esc)
204 \r (no-eol) (esc)
202 \r (no-eol) (esc)
205 converting [=======================> ] 4/7\r (no-eol) (esc)
203 converting [=======================> ] 4/7\r (no-eol) (esc)
206 scanning paths [ ] 0/1\r (no-eol) (esc)
204 scanning paths [ ] 0/1\r (no-eol) (esc)
207 getting files [======================================>] 1/1\r (no-eol) (esc)
205 getting files [======================================>] 1/1\r (no-eol) (esc)
208 \r (no-eol) (esc)
206 \r (no-eol) (esc)
209 \r (no-eol) (esc)
207 \r (no-eol) (esc)
210 converting [=============================> ] 5/7\r (no-eol) (esc)
208 converting [=============================> ] 5/7\r (no-eol) (esc)
211 scanning paths [ ] 0/1\r (no-eol) (esc)
209 scanning paths [ ] 0/1\r (no-eol) (esc)
212 getting files [===> ] 1/8\r (no-eol) (esc)
210 getting files [===> ] 1/8\r (no-eol) (esc)
213 getting files [========> ] 2/8\r (no-eol) (esc)
211 getting files [========> ] 2/8\r (no-eol) (esc)
214 getting files [=============> ] 3/8\r (no-eol) (esc)
212 getting files [=============> ] 3/8\r (no-eol) (esc)
215 getting files [==================> ] 4/8\r (no-eol) (esc)
213 getting files [==================> ] 4/8\r (no-eol) (esc)
216 getting files [=======================> ] 5/8\r (no-eol) (esc)
214 getting files [=======================> ] 5/8\r (no-eol) (esc)
217 getting files [============================> ] 6/8\r (no-eol) (esc)
215 getting files [============================> ] 6/8\r (no-eol) (esc)
218 getting files [=================================> ] 7/8\r (no-eol) (esc)
216 getting files [=================================> ] 7/8\r (no-eol) (esc)
219 getting files [======================================>] 8/8\r (no-eol) (esc)
217 getting files [======================================>] 8/8\r (no-eol) (esc)
220 \r (no-eol) (esc)
218 \r (no-eol) (esc)
221 \r (no-eol) (esc)
219 \r (no-eol) (esc)
222 converting [===================================> ] 6/7\r (no-eol) (esc)
220 converting [===================================> ] 6/7\r (no-eol) (esc)
223 scanning paths [ ] 0/3\r (no-eol) (esc)
221 scanning paths [ ] 0/3\r (no-eol) (esc)
224 scanning paths [===========> ] 1/3\r (no-eol) (esc)
222 scanning paths [===========> ] 1/3\r (no-eol) (esc)
225 scanning paths [========================> ] 2/3\r (no-eol) (esc)
223 scanning paths [========================> ] 2/3\r (no-eol) (esc)
226 getting files [===> ] 1/8\r (no-eol) (esc)
224 getting files [===> ] 1/8\r (no-eol) (esc)
227 getting files [========> ] 2/8\r (no-eol) (esc)
225 getting files [========> ] 2/8\r (no-eol) (esc)
228 getting files [=============> ] 3/8\r (no-eol) (esc)
226 getting files [=============> ] 3/8\r (no-eol) (esc)
229 getting files [==================> ] 4/8\r (no-eol) (esc)
227 getting files [==================> ] 4/8\r (no-eol) (esc)
230 getting files [=======================> ] 5/8\r (no-eol) (esc)
228 getting files [=======================> ] 5/8\r (no-eol) (esc)
231 getting files [============================> ] 6/8\r (no-eol) (esc)
229 getting files [============================> ] 6/8\r (no-eol) (esc)
232 getting files [=================================> ] 7/8\r (no-eol) (esc)
230 getting files [=================================> ] 7/8\r (no-eol) (esc)
233 getting files [======================================>] 8/8\r (no-eol) (esc)
231 getting files [======================================>] 8/8\r (no-eol) (esc)
234 \r (no-eol) (esc)
232 \r (no-eol) (esc)
235 initializing destination hg-progress repository
233 initializing destination hg-progress repository
236 scanning source...
234 scanning source...
237 sorting...
235 sorting...
238 converting...
236 converting...
239 6 initial
237 6 initial
240 5 clobber symlink
238 5 clobber symlink
241 4 clobber1
239 4 clobber1
242 3 clobber2
240 3 clobber2
243 2 adddb
241 2 adddb
244 1 clobberdir
242 1 clobberdir
245 0 branch
243 0 branch
246
244
247 $ cd ..
245 $ cd ..
@@ -1,570 +1,568 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 (glob)
26 adding foo/bar/z.txt (glob)
27 $ hg add -S
27 $ hg add -S
28 adding x.txt
28 adding x.txt
29 adding foo/y.txt (glob)
29 adding foo/y.txt (glob)
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 fails
61 $ hg commit -m fails
62 abort: uncommitted changes in subrepository 'foo'
62 abort: uncommitted changes in subrepository 'foo'
63 (use --subrepos for recursive commit)
63 (use --subrepos for recursive commit)
64 [255]
64 [255]
65
65
66 The --subrepos flag overwrite the config setting:
66 The --subrepos flag overwrite the config setting:
67
67
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
69 committing subrepository foo
69 committing subrepository foo
70 committing subrepository foo/bar (glob)
70 committing subrepository foo/bar (glob)
71
71
72 $ cd foo
72 $ cd foo
73 $ echo y2 >> y.txt
73 $ echo y2 >> y.txt
74 $ hg commit -m 0-1-0
74 $ hg commit -m 0-1-0
75
75
76 $ cd bar
76 $ cd bar
77 $ echo z2 >> z.txt
77 $ echo z2 >> z.txt
78 $ hg commit -m 0-1-1
78 $ hg commit -m 0-1-1
79
79
80 $ cd ..
80 $ cd ..
81 $ hg commit -m 0-2-1
81 $ hg commit -m 0-2-1
82
82
83 $ cd ..
83 $ cd ..
84 $ hg commit -m 1-2-1
84 $ hg commit -m 1-2-1
85
85
86 Change working directory:
86 Change working directory:
87
87
88 $ echo y3 >> foo/y.txt
88 $ echo y3 >> foo/y.txt
89 $ echo z3 >> foo/bar/z.txt
89 $ echo z3 >> foo/bar/z.txt
90 $ hg status -S
90 $ hg status -S
91 M foo/bar/z.txt
91 M foo/bar/z.txt
92 M foo/y.txt
92 M foo/y.txt
93 $ hg diff --nodates -S
93 $ hg diff --nodates -S
94 diff -r d254738c5f5e foo/y.txt
94 diff -r d254738c5f5e foo/y.txt
95 --- a/foo/y.txt
95 --- a/foo/y.txt
96 +++ b/foo/y.txt
96 +++ b/foo/y.txt
97 @@ -1,2 +1,3 @@
97 @@ -1,2 +1,3 @@
98 y1
98 y1
99 y2
99 y2
100 +y3
100 +y3
101 diff -r 9647f22de499 foo/bar/z.txt
101 diff -r 9647f22de499 foo/bar/z.txt
102 --- a/foo/bar/z.txt
102 --- a/foo/bar/z.txt
103 +++ b/foo/bar/z.txt
103 +++ b/foo/bar/z.txt
104 @@ -1,2 +1,3 @@
104 @@ -1,2 +1,3 @@
105 z1
105 z1
106 z2
106 z2
107 +z3
107 +z3
108
108
109 Status call crossing repository boundaries:
109 Status call crossing repository boundaries:
110
110
111 $ hg status -S foo/bar/z.txt
111 $ hg status -S foo/bar/z.txt
112 M foo/bar/z.txt
112 M foo/bar/z.txt
113 $ hg status -S -I 'foo/?.txt'
113 $ hg status -S -I 'foo/?.txt'
114 M foo/y.txt
114 M foo/y.txt
115 $ hg status -S -I '**/?.txt'
115 $ hg status -S -I '**/?.txt'
116 M foo/bar/z.txt
116 M foo/bar/z.txt
117 M foo/y.txt
117 M foo/y.txt
118 $ hg diff --nodates -S -I '**/?.txt'
118 $ hg diff --nodates -S -I '**/?.txt'
119 diff -r d254738c5f5e foo/y.txt
119 diff -r d254738c5f5e foo/y.txt
120 --- a/foo/y.txt
120 --- a/foo/y.txt
121 +++ b/foo/y.txt
121 +++ b/foo/y.txt
122 @@ -1,2 +1,3 @@
122 @@ -1,2 +1,3 @@
123 y1
123 y1
124 y2
124 y2
125 +y3
125 +y3
126 diff -r 9647f22de499 foo/bar/z.txt
126 diff -r 9647f22de499 foo/bar/z.txt
127 --- a/foo/bar/z.txt
127 --- a/foo/bar/z.txt
128 +++ b/foo/bar/z.txt
128 +++ b/foo/bar/z.txt
129 @@ -1,2 +1,3 @@
129 @@ -1,2 +1,3 @@
130 z1
130 z1
131 z2
131 z2
132 +z3
132 +z3
133
133
134 Status from within a subdirectory:
134 Status from within a subdirectory:
135
135
136 $ mkdir dir
136 $ mkdir dir
137 $ cd dir
137 $ cd dir
138 $ echo a1 > a.txt
138 $ echo a1 > a.txt
139 $ hg status -S
139 $ hg status -S
140 M foo/bar/z.txt
140 M foo/bar/z.txt
141 M foo/y.txt
141 M foo/y.txt
142 ? dir/a.txt
142 ? dir/a.txt
143 $ hg diff --nodates -S
143 $ hg diff --nodates -S
144 diff -r d254738c5f5e foo/y.txt
144 diff -r d254738c5f5e foo/y.txt
145 --- a/foo/y.txt
145 --- a/foo/y.txt
146 +++ b/foo/y.txt
146 +++ b/foo/y.txt
147 @@ -1,2 +1,3 @@
147 @@ -1,2 +1,3 @@
148 y1
148 y1
149 y2
149 y2
150 +y3
150 +y3
151 diff -r 9647f22de499 foo/bar/z.txt
151 diff -r 9647f22de499 foo/bar/z.txt
152 --- a/foo/bar/z.txt
152 --- a/foo/bar/z.txt
153 +++ b/foo/bar/z.txt
153 +++ b/foo/bar/z.txt
154 @@ -1,2 +1,3 @@
154 @@ -1,2 +1,3 @@
155 z1
155 z1
156 z2
156 z2
157 +z3
157 +z3
158
158
159 Status with relative path:
159 Status with relative path:
160
160
161 $ hg status -S ..
161 $ hg status -S ..
162 M ../foo/bar/z.txt
162 M ../foo/bar/z.txt
163 M ../foo/y.txt
163 M ../foo/y.txt
164 ? a.txt
164 ? a.txt
165
165
166 XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as
166 XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as
167 added instead of modified.
167 added instead of modified.
168 $ hg status -S .. --config extensions.largefiles=
168 $ hg status -S .. --config extensions.largefiles=
169 M ../foo/bar/z.txt
169 M ../foo/bar/z.txt
170 M ../foo/y.txt
170 M ../foo/y.txt
171 ? a.txt
171 ? a.txt
172
172
173 $ hg diff --nodates -S ..
173 $ hg diff --nodates -S ..
174 diff -r d254738c5f5e foo/y.txt
174 diff -r d254738c5f5e foo/y.txt
175 --- a/foo/y.txt
175 --- a/foo/y.txt
176 +++ b/foo/y.txt
176 +++ b/foo/y.txt
177 @@ -1,2 +1,3 @@
177 @@ -1,2 +1,3 @@
178 y1
178 y1
179 y2
179 y2
180 +y3
180 +y3
181 diff -r 9647f22de499 foo/bar/z.txt
181 diff -r 9647f22de499 foo/bar/z.txt
182 --- a/foo/bar/z.txt
182 --- a/foo/bar/z.txt
183 +++ b/foo/bar/z.txt
183 +++ b/foo/bar/z.txt
184 @@ -1,2 +1,3 @@
184 @@ -1,2 +1,3 @@
185 z1
185 z1
186 z2
186 z2
187 +z3
187 +z3
188 $ cd ..
188 $ cd ..
189
189
190 Cleanup and final commit:
190 Cleanup and final commit:
191
191
192 $ rm -r dir
192 $ rm -r dir
193 $ hg commit --subrepos -m 2-3-2
193 $ hg commit --subrepos -m 2-3-2
194 committing subrepository foo
194 committing subrepository foo
195 committing subrepository foo/bar (glob)
195 committing subrepository foo/bar (glob)
196
196
197 Test explicit path commands within subrepos: add/forget
197 Test explicit path commands within subrepos: add/forget
198 $ echo z1 > foo/bar/z2.txt
198 $ echo z1 > foo/bar/z2.txt
199 $ hg status -S
199 $ hg status -S
200 ? foo/bar/z2.txt
200 ? foo/bar/z2.txt
201 $ hg add foo/bar/z2.txt
201 $ hg add foo/bar/z2.txt
202 $ hg status -S
202 $ hg status -S
203 A foo/bar/z2.txt
203 A foo/bar/z2.txt
204 $ hg forget foo/bar/z2.txt
204 $ hg forget foo/bar/z2.txt
205 $ hg status -S
205 $ hg status -S
206 ? foo/bar/z2.txt
206 ? foo/bar/z2.txt
207 $ hg forget foo/bar/z2.txt
207 $ hg forget foo/bar/z2.txt
208 not removing foo/bar/z2.txt: file is already untracked (glob)
208 not removing foo/bar/z2.txt: file is already untracked (glob)
209 [1]
209 [1]
210 $ hg status -S
210 $ hg status -S
211 ? foo/bar/z2.txt
211 ? foo/bar/z2.txt
212 $ rm foo/bar/z2.txt
212 $ rm foo/bar/z2.txt
213
213
214 Log with the relationships between repo and its subrepo:
214 Log with the relationships between repo and its subrepo:
215
215
216 $ hg log --template '{rev}:{node|short} {desc}\n'
216 $ hg log --template '{rev}:{node|short} {desc}\n'
217 2:1326fa26d0c0 2-3-2
217 2:1326fa26d0c0 2-3-2
218 1:4b3c9ff4f66b 1-2-1
218 1:4b3c9ff4f66b 1-2-1
219 0:23376cbba0d8 0-0-0
219 0:23376cbba0d8 0-0-0
220
220
221 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
221 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
222 3:65903cebad86 2-3-2
222 3:65903cebad86 2-3-2
223 2:d254738c5f5e 0-2-1
223 2:d254738c5f5e 0-2-1
224 1:8629ce7dcc39 0-1-0
224 1:8629ce7dcc39 0-1-0
225 0:af048e97ade2 0-0-0
225 0:af048e97ade2 0-0-0
226
226
227 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
227 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
228 2:31ecbdafd357 2-3-2
228 2:31ecbdafd357 2-3-2
229 1:9647f22de499 0-1-1
229 1:9647f22de499 0-1-1
230 0:4904098473f9 0-0-0
230 0:4904098473f9 0-0-0
231
231
232 Status between revisions:
232 Status between revisions:
233
233
234 $ hg status -S
234 $ hg status -S
235 $ hg status -S --rev 0:1
235 $ hg status -S --rev 0:1
236 M .hgsubstate
236 M .hgsubstate
237 M foo/.hgsubstate
237 M foo/.hgsubstate
238 M foo/bar/z.txt
238 M foo/bar/z.txt
239 M foo/y.txt
239 M foo/y.txt
240 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
240 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
241 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
241 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
242 --- a/foo/y.txt
242 --- a/foo/y.txt
243 +++ b/foo/y.txt
243 +++ b/foo/y.txt
244 @@ -1,1 +1,2 @@
244 @@ -1,1 +1,2 @@
245 y1
245 y1
246 +y2
246 +y2
247 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
247 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
248 --- a/foo/bar/z.txt
248 --- a/foo/bar/z.txt
249 +++ b/foo/bar/z.txt
249 +++ b/foo/bar/z.txt
250 @@ -1,1 +1,2 @@
250 @@ -1,1 +1,2 @@
251 z1
251 z1
252 +z2
252 +z2
253
253
254 Enable progress extension for archive tests:
254 Enable progress extension for archive tests:
255
255
256 $ cp $HGRCPATH $HGRCPATH.no-progress
256 $ cp $HGRCPATH $HGRCPATH.no-progress
257 $ cat >> $HGRCPATH <<EOF
257 $ cat >> $HGRCPATH <<EOF
258 > [extensions]
259 > progress =
260 > [progress]
258 > [progress]
261 > disable=False
259 > disable=False
262 > assume-tty = 1
260 > assume-tty = 1
263 > delay = 0
261 > delay = 0
264 > # set changedelay really large so we don't see nested topics
262 > # set changedelay really large so we don't see nested topics
265 > changedelay = 30000
263 > changedelay = 30000
266 > format = topic bar number
264 > format = topic bar number
267 > refresh = 0
265 > refresh = 0
268 > width = 60
266 > width = 60
269 > EOF
267 > EOF
270
268
271 Test archiving to a directory tree (the doubled lines in the output
269 Test archiving to a directory tree (the doubled lines in the output
272 only show up in the test output, not in real usage):
270 only show up in the test output, not in real usage):
273
271
274 $ hg archive --subrepos ../archive
272 $ hg archive --subrepos ../archive
275 \r (no-eol) (esc)
273 \r (no-eol) (esc)
276 archiving [ ] 0/3\r (no-eol) (esc)
274 archiving [ ] 0/3\r (no-eol) (esc)
277 archiving [=============> ] 1/3\r (no-eol) (esc)
275 archiving [=============> ] 1/3\r (no-eol) (esc)
278 archiving [===========================> ] 2/3\r (no-eol) (esc)
276 archiving [===========================> ] 2/3\r (no-eol) (esc)
279 archiving [==========================================>] 3/3\r (no-eol) (esc)
277 archiving [==========================================>] 3/3\r (no-eol) (esc)
280 \r (no-eol) (esc)
278 \r (no-eol) (esc)
281 \r (no-eol) (esc)
279 \r (no-eol) (esc)
282 archiving (foo) [ ] 0/3\r (no-eol) (esc)
280 archiving (foo) [ ] 0/3\r (no-eol) (esc)
283 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
281 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
284 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
282 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
285 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
283 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
286 \r (no-eol) (esc)
284 \r (no-eol) (esc)
287 \r (no-eol) (esc)
285 \r (no-eol) (esc)
288 archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc)
286 archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc)
289 archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
287 archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
290 \r (no-eol) (esc)
288 \r (no-eol) (esc)
291 $ find ../archive | sort
289 $ find ../archive | sort
292 ../archive
290 ../archive
293 ../archive/.hg_archival.txt
291 ../archive/.hg_archival.txt
294 ../archive/.hgsub
292 ../archive/.hgsub
295 ../archive/.hgsubstate
293 ../archive/.hgsubstate
296 ../archive/foo
294 ../archive/foo
297 ../archive/foo/.hgsub
295 ../archive/foo/.hgsub
298 ../archive/foo/.hgsubstate
296 ../archive/foo/.hgsubstate
299 ../archive/foo/bar
297 ../archive/foo/bar
300 ../archive/foo/bar/z.txt
298 ../archive/foo/bar/z.txt
301 ../archive/foo/y.txt
299 ../archive/foo/y.txt
302 ../archive/x.txt
300 ../archive/x.txt
303
301
304 Test archiving to zip file (unzip output is unstable):
302 Test archiving to zip file (unzip output is unstable):
305
303
306 $ hg archive --subrepos --prefix '.' ../archive.zip
304 $ hg archive --subrepos --prefix '.' ../archive.zip
307 \r (no-eol) (esc)
305 \r (no-eol) (esc)
308 archiving [ ] 0/3\r (no-eol) (esc)
306 archiving [ ] 0/3\r (no-eol) (esc)
309 archiving [=============> ] 1/3\r (no-eol) (esc)
307 archiving [=============> ] 1/3\r (no-eol) (esc)
310 archiving [===========================> ] 2/3\r (no-eol) (esc)
308 archiving [===========================> ] 2/3\r (no-eol) (esc)
311 archiving [==========================================>] 3/3\r (no-eol) (esc)
309 archiving [==========================================>] 3/3\r (no-eol) (esc)
312 \r (no-eol) (esc)
310 \r (no-eol) (esc)
313 \r (no-eol) (esc)
311 \r (no-eol) (esc)
314 archiving (foo) [ ] 0/3\r (no-eol) (esc)
312 archiving (foo) [ ] 0/3\r (no-eol) (esc)
315 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
313 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
316 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
314 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
317 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
315 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
318 \r (no-eol) (esc)
316 \r (no-eol) (esc)
319 \r (no-eol) (esc)
317 \r (no-eol) (esc)
320 archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc)
318 archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc)
321 archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
319 archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
322 \r (no-eol) (esc)
320 \r (no-eol) (esc)
323
321
324 (unzip date formating is unstable, we do not care about it and glob it out)
322 (unzip date formating is unstable, we do not care about it and glob it out)
325
323
326 $ unzip -l ../archive.zip
324 $ unzip -l ../archive.zip
327 Archive: ../archive.zip
325 Archive: ../archive.zip
328 Length [ ]* Date [ ]* Time [ ]* Name (re)
326 Length [ ]* Date [ ]* Time [ ]* Name (re)
329 [\- ]* (re)
327 [\- ]* (re)
330 172 [0-9:\- ]* .hg_archival.txt (re)
328 172 [0-9:\- ]* .hg_archival.txt (re)
331 10 [0-9:\- ]* .hgsub (re)
329 10 [0-9:\- ]* .hgsub (re)
332 45 [0-9:\- ]* .hgsubstate (re)
330 45 [0-9:\- ]* .hgsubstate (re)
333 3 [0-9:\- ]* x.txt (re)
331 3 [0-9:\- ]* x.txt (re)
334 10 [0-9:\- ]* foo/.hgsub (re)
332 10 [0-9:\- ]* foo/.hgsub (re)
335 45 [0-9:\- ]* foo/.hgsubstate (re)
333 45 [0-9:\- ]* foo/.hgsubstate (re)
336 9 [0-9:\- ]* foo/y.txt (re)
334 9 [0-9:\- ]* foo/y.txt (re)
337 9 [0-9:\- ]* foo/bar/z.txt (re)
335 9 [0-9:\- ]* foo/bar/z.txt (re)
338 [\- ]* (re)
336 [\- ]* (re)
339 303 [ ]* 8 files (re)
337 303 [ ]* 8 files (re)
340
338
341 Test archiving a revision that references a subrepo that is not yet
339 Test archiving a revision that references a subrepo that is not yet
342 cloned:
340 cloned:
343
341
344 #if hardlink
342 #if hardlink
345 $ hg clone -U . ../empty
343 $ hg clone -U . ../empty
346 \r (no-eol) (esc)
344 \r (no-eol) (esc)
347 linking [ <=> ] 1\r (no-eol) (esc)
345 linking [ <=> ] 1\r (no-eol) (esc)
348 linking [ <=> ] 2\r (no-eol) (esc)
346 linking [ <=> ] 2\r (no-eol) (esc)
349 linking [ <=> ] 3\r (no-eol) (esc)
347 linking [ <=> ] 3\r (no-eol) (esc)
350 linking [ <=> ] 4\r (no-eol) (esc)
348 linking [ <=> ] 4\r (no-eol) (esc)
351 linking [ <=> ] 5\r (no-eol) (esc)
349 linking [ <=> ] 5\r (no-eol) (esc)
352 linking [ <=> ] 6\r (no-eol) (esc)
350 linking [ <=> ] 6\r (no-eol) (esc)
353 linking [ <=> ] 7\r (no-eol) (esc)
351 linking [ <=> ] 7\r (no-eol) (esc)
354 linking [ <=> ] 8\r (no-eol) (esc)
352 linking [ <=> ] 8\r (no-eol) (esc)
355 \r (no-eol) (esc)
353 \r (no-eol) (esc)
356 #else
354 #else
357 $ hg clone -U . ../empty
355 $ hg clone -U . ../empty
358 \r (no-eol) (esc)
356 \r (no-eol) (esc)
359 linking [ <=> ] 1 (no-eol)
357 linking [ <=> ] 1 (no-eol)
360 #endif
358 #endif
361
359
362 $ cd ../empty
360 $ cd ../empty
363 #if hardlink
361 #if hardlink
364 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
362 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
365 \r (no-eol) (esc)
363 \r (no-eol) (esc)
366 archiving [ ] 0/3\r (no-eol) (esc)
364 archiving [ ] 0/3\r (no-eol) (esc)
367 archiving [=============> ] 1/3\r (no-eol) (esc)
365 archiving [=============> ] 1/3\r (no-eol) (esc)
368 archiving [===========================> ] 2/3\r (no-eol) (esc)
366 archiving [===========================> ] 2/3\r (no-eol) (esc)
369 archiving [==========================================>] 3/3\r (no-eol) (esc)
367 archiving [==========================================>] 3/3\r (no-eol) (esc)
370 \r (no-eol) (esc)
368 \r (no-eol) (esc)
371 \r (no-eol) (esc)
369 \r (no-eol) (esc)
372 linking [ <=> ] 1\r (no-eol) (esc)
370 linking [ <=> ] 1\r (no-eol) (esc)
373 linking [ <=> ] 2\r (no-eol) (esc)
371 linking [ <=> ] 2\r (no-eol) (esc)
374 linking [ <=> ] 3\r (no-eol) (esc)
372 linking [ <=> ] 3\r (no-eol) (esc)
375 linking [ <=> ] 4\r (no-eol) (esc)
373 linking [ <=> ] 4\r (no-eol) (esc)
376 linking [ <=> ] 5\r (no-eol) (esc)
374 linking [ <=> ] 5\r (no-eol) (esc)
377 linking [ <=> ] 6\r (no-eol) (esc)
375 linking [ <=> ] 6\r (no-eol) (esc)
378 linking [ <=> ] 7\r (no-eol) (esc)
376 linking [ <=> ] 7\r (no-eol) (esc)
379 linking [ <=> ] 8\r (no-eol) (esc)
377 linking [ <=> ] 8\r (no-eol) (esc)
380 \r (no-eol) (esc)
378 \r (no-eol) (esc)
381 \r (no-eol) (esc)
379 \r (no-eol) (esc)
382 archiving (foo) [ ] 0/3\r (no-eol) (esc)
380 archiving (foo) [ ] 0/3\r (no-eol) (esc)
383 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
381 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
384 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
382 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
385 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
383 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
386 \r (no-eol) (esc)
384 \r (no-eol) (esc)
387 \r (no-eol) (esc)
385 \r (no-eol) (esc)
388 linking [ <=> ] 1\r (no-eol) (esc)
386 linking [ <=> ] 1\r (no-eol) (esc)
389 linking [ <=> ] 2\r (no-eol) (esc)
387 linking [ <=> ] 2\r (no-eol) (esc)
390 linking [ <=> ] 3\r (no-eol) (esc)
388 linking [ <=> ] 3\r (no-eol) (esc)
391 linking [ <=> ] 4\r (no-eol) (esc)
389 linking [ <=> ] 4\r (no-eol) (esc)
392 linking [ <=> ] 5\r (no-eol) (esc)
390 linking [ <=> ] 5\r (no-eol) (esc)
393 linking [ <=> ] 6\r (no-eol) (esc)
391 linking [ <=> ] 6\r (no-eol) (esc)
394 \r (no-eol) (esc)
392 \r (no-eol) (esc)
395 \r (no-eol) (esc)
393 \r (no-eol) (esc)
396 archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc)
394 archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc)
397 archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
395 archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
398 \r (no-eol) (esc)
396 \r (no-eol) (esc)
399 cloning subrepo foo from $TESTTMP/repo/foo
397 cloning subrepo foo from $TESTTMP/repo/foo
400 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
398 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
401 #else
399 #else
402 Note there's a slight output glitch on non-hardlink systems: the last
400 Note there's a slight output glitch on non-hardlink systems: the last
403 "linking" progress topic never gets closed, leading to slight output corruption on that platform.
401 "linking" progress topic never gets closed, leading to slight output corruption on that platform.
404 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
402 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
405 \r (no-eol) (esc)
403 \r (no-eol) (esc)
406 archiving [ ] 0/3\r (no-eol) (esc)
404 archiving [ ] 0/3\r (no-eol) (esc)
407 archiving [=============> ] 1/3\r (no-eol) (esc)
405 archiving [=============> ] 1/3\r (no-eol) (esc)
408 archiving [===========================> ] 2/3\r (no-eol) (esc)
406 archiving [===========================> ] 2/3\r (no-eol) (esc)
409 archiving [==========================================>] 3/3\r (no-eol) (esc)
407 archiving [==========================================>] 3/3\r (no-eol) (esc)
410 \r (no-eol) (esc)
408 \r (no-eol) (esc)
411 \r (no-eol) (esc)
409 \r (no-eol) (esc)
412 linking [ <=> ] 1\r (no-eol) (esc)
410 linking [ <=> ] 1\r (no-eol) (esc)
413 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
411 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
414 #endif
412 #endif
415
413
416 Archive + subrepos uses '/' for all component separators
414 Archive + subrepos uses '/' for all component separators
417
415
418 $ tar -tzf ../archive.tar.gz | sort
416 $ tar -tzf ../archive.tar.gz | sort
419 .hg_archival.txt
417 .hg_archival.txt
420 .hgsub
418 .hgsub
421 .hgsubstate
419 .hgsubstate
422 foo/.hgsub
420 foo/.hgsub
423 foo/.hgsubstate
421 foo/.hgsubstate
424 foo/bar/z.txt
422 foo/bar/z.txt
425 foo/y.txt
423 foo/y.txt
426 x.txt
424 x.txt
427
425
428 The newly cloned subrepos contain no working copy:
426 The newly cloned subrepos contain no working copy:
429
427
430 $ hg -R foo summary
428 $ hg -R foo summary
431 parent: -1:000000000000 (no revision checked out)
429 parent: -1:000000000000 (no revision checked out)
432 branch: default
430 branch: default
433 commit: (clean)
431 commit: (clean)
434 update: 4 new changesets (update)
432 update: 4 new changesets (update)
435
433
436 Disable progress extension and cleanup:
434 Disable progress extension and cleanup:
437
435
438 $ mv $HGRCPATH.no-progress $HGRCPATH
436 $ mv $HGRCPATH.no-progress $HGRCPATH
439
437
440 Test archiving when there is a directory in the way for a subrepo
438 Test archiving when there is a directory in the way for a subrepo
441 created by archive:
439 created by archive:
442
440
443 $ hg clone -U . ../almost-empty
441 $ hg clone -U . ../almost-empty
444 $ cd ../almost-empty
442 $ cd ../almost-empty
445 $ mkdir foo
443 $ mkdir foo
446 $ echo f > foo/f
444 $ echo f > foo/f
447 $ hg archive --subrepos -r tip archive
445 $ hg archive --subrepos -r tip archive
448 cloning subrepo foo from $TESTTMP/empty/foo
446 cloning subrepo foo from $TESTTMP/empty/foo
449 abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepo foo) (glob)
447 abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepo foo) (glob)
450 [255]
448 [255]
451
449
452 Clone and test outgoing:
450 Clone and test outgoing:
453
451
454 $ cd ..
452 $ cd ..
455 $ hg clone repo repo2
453 $ hg clone repo repo2
456 updating to branch default
454 updating to branch default
457 cloning subrepo foo from $TESTTMP/repo/foo
455 cloning subrepo foo from $TESTTMP/repo/foo
458 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
456 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
459 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 $ cd repo2
458 $ cd repo2
461 $ hg outgoing -S
459 $ hg outgoing -S
462 comparing with $TESTTMP/repo (glob)
460 comparing with $TESTTMP/repo (glob)
463 searching for changes
461 searching for changes
464 no changes found
462 no changes found
465 comparing with $TESTTMP/repo/foo
463 comparing with $TESTTMP/repo/foo
466 searching for changes
464 searching for changes
467 no changes found
465 no changes found
468 comparing with $TESTTMP/repo/foo/bar
466 comparing with $TESTTMP/repo/foo/bar
469 searching for changes
467 searching for changes
470 no changes found
468 no changes found
471 [1]
469 [1]
472
470
473 Make nested change:
471 Make nested change:
474
472
475 $ echo y4 >> foo/y.txt
473 $ echo y4 >> foo/y.txt
476 $ hg diff --nodates -S
474 $ hg diff --nodates -S
477 diff -r 65903cebad86 foo/y.txt
475 diff -r 65903cebad86 foo/y.txt
478 --- a/foo/y.txt
476 --- a/foo/y.txt
479 +++ b/foo/y.txt
477 +++ b/foo/y.txt
480 @@ -1,3 +1,4 @@
478 @@ -1,3 +1,4 @@
481 y1
479 y1
482 y2
480 y2
483 y3
481 y3
484 +y4
482 +y4
485 $ hg commit --subrepos -m 3-4-2
483 $ hg commit --subrepos -m 3-4-2
486 committing subrepository foo
484 committing subrepository foo
487 $ hg outgoing -S
485 $ hg outgoing -S
488 comparing with $TESTTMP/repo (glob)
486 comparing with $TESTTMP/repo (glob)
489 searching for changes
487 searching for changes
490 changeset: 3:2655b8ecc4ee
488 changeset: 3:2655b8ecc4ee
491 tag: tip
489 tag: tip
492 user: test
490 user: test
493 date: Thu Jan 01 00:00:00 1970 +0000
491 date: Thu Jan 01 00:00:00 1970 +0000
494 summary: 3-4-2
492 summary: 3-4-2
495
493
496 comparing with $TESTTMP/repo/foo
494 comparing with $TESTTMP/repo/foo
497 searching for changes
495 searching for changes
498 changeset: 4:e96193d6cb36
496 changeset: 4:e96193d6cb36
499 tag: tip
497 tag: tip
500 user: test
498 user: test
501 date: Thu Jan 01 00:00:00 1970 +0000
499 date: Thu Jan 01 00:00:00 1970 +0000
502 summary: 3-4-2
500 summary: 3-4-2
503
501
504 comparing with $TESTTMP/repo/foo/bar
502 comparing with $TESTTMP/repo/foo/bar
505 searching for changes
503 searching for changes
506 no changes found
504 no changes found
507
505
508
506
509 Switch to original repo and setup default path:
507 Switch to original repo and setup default path:
510
508
511 $ cd ../repo
509 $ cd ../repo
512 $ echo '[paths]' >> .hg/hgrc
510 $ echo '[paths]' >> .hg/hgrc
513 $ echo 'default = ../repo2' >> .hg/hgrc
511 $ echo 'default = ../repo2' >> .hg/hgrc
514
512
515 Test incoming:
513 Test incoming:
516
514
517 $ hg incoming -S
515 $ hg incoming -S
518 comparing with $TESTTMP/repo2 (glob)
516 comparing with $TESTTMP/repo2 (glob)
519 searching for changes
517 searching for changes
520 changeset: 3:2655b8ecc4ee
518 changeset: 3:2655b8ecc4ee
521 tag: tip
519 tag: tip
522 user: test
520 user: test
523 date: Thu Jan 01 00:00:00 1970 +0000
521 date: Thu Jan 01 00:00:00 1970 +0000
524 summary: 3-4-2
522 summary: 3-4-2
525
523
526 comparing with $TESTTMP/repo2/foo
524 comparing with $TESTTMP/repo2/foo
527 searching for changes
525 searching for changes
528 changeset: 4:e96193d6cb36
526 changeset: 4:e96193d6cb36
529 tag: tip
527 tag: tip
530 user: test
528 user: test
531 date: Thu Jan 01 00:00:00 1970 +0000
529 date: Thu Jan 01 00:00:00 1970 +0000
532 summary: 3-4-2
530 summary: 3-4-2
533
531
534 comparing with $TESTTMP/repo2/foo/bar
532 comparing with $TESTTMP/repo2/foo/bar
535 searching for changes
533 searching for changes
536 no changes found
534 no changes found
537
535
538 $ hg incoming -S --bundle incoming.hg
536 $ hg incoming -S --bundle incoming.hg
539 abort: cannot combine --bundle and --subrepos
537 abort: cannot combine --bundle and --subrepos
540 [255]
538 [255]
541
539
542 Test missing subrepo:
540 Test missing subrepo:
543
541
544 $ rm -r foo
542 $ rm -r foo
545 $ hg status -S
543 $ hg status -S
546 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
544 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
547
545
548 Issue2619: IndexError: list index out of range on hg add with subrepos
546 Issue2619: IndexError: list index out of range on hg add with subrepos
549 The subrepo must sorts after the explicit filename.
547 The subrepo must sorts after the explicit filename.
550
548
551 $ cd ..
549 $ cd ..
552 $ hg init test
550 $ hg init test
553 $ cd test
551 $ cd test
554 $ hg init x
552 $ hg init x
555 $ echo abc > abc.txt
553 $ echo abc > abc.txt
556 $ hg ci -Am "abc"
554 $ hg ci -Am "abc"
557 adding abc.txt
555 adding abc.txt
558 $ echo "x = x" >> .hgsub
556 $ echo "x = x" >> .hgsub
559 $ hg add .hgsub
557 $ hg add .hgsub
560 $ touch a x/a
558 $ touch a x/a
561 $ hg add a x/a
559 $ hg add a x/a
562
560
563 $ hg ci -Sm "added x"
561 $ hg ci -Sm "added x"
564 committing subrepository x
562 committing subrepository x
565 $ echo abc > x/a
563 $ echo abc > x/a
566 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
564 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
567 abort: subrepository 'x' does not exist in 25ac2c9b3180!
565 abort: subrepository 'x' does not exist in 25ac2c9b3180!
568 [255]
566 [255]
569
567
570 $ cd ..
568 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now