##// END OF EJS Templates
merge with stable
Matt Mackall -
r23244:18cc87e4 merge default
parent child Browse files
Show More
@@ -99,7 +99,7 b' class convert_git(converter_source):'
99 if similarity < 0 or similarity > 100:
99 if similarity < 0 or similarity > 100:
100 raise util.Abort(_('similarity must be between 0 and 100'))
100 raise util.Abort(_('similarity must be between 0 and 100'))
101 if similarity > 0:
101 if similarity > 0:
102 self.simopt = '--find-copies=%d%%' % similarity
102 self.simopt = '-C%d%%' % similarity
103 findcopiesharder = ui.configbool('convert', 'git.findcopiesharder',
103 findcopiesharder = ui.configbool('convert', 'git.findcopiesharder',
104 False)
104 False)
105 if findcopiesharder:
105 if findcopiesharder:
@@ -339,6 +339,11 b' class cg1packer(object):'
339 mfs.setdefault(c[0], x)
339 mfs.setdefault(c[0], x)
340 return x
340 return x
341
341
342 for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets'),
343 reorder=reorder):
344 yield chunk
345 progress(msgbundling, None)
346
342 # Callback for the manifest, used to collect linkrevs for filelog
347 # Callback for the manifest, used to collect linkrevs for filelog
343 # revisions.
348 # revisions.
344 # Returns the linkrev node (collected in lookupcl).
349 # Returns the linkrev node (collected in lookupcl).
@@ -350,16 +355,9 b' class cg1packer(object):'
350 if f in changedfiles:
355 if f in changedfiles:
351 # record the first changeset introducing this filelog
356 # record the first changeset introducing this filelog
352 # version
357 # version
353 fnodes[f].setdefault(n, clnode)
358 fnodes.setdefault(f, {}).setdefault(n, clnode)
354 return clnode
359 return clnode
355
360
356 for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets'),
357 reorder=reorder):
358 yield chunk
359 progress(msgbundling, None)
360
361 for f in changedfiles:
362 fnodes[f] = {}
363 mfnodes = self.prune(mf, mfs, commonrevs, source)
361 mfnodes = self.prune(mf, mfs, commonrevs, source)
364 for chunk in self.group(mfnodes, mf, lookupmf, units=_('manifests'),
362 for chunk in self.group(mfnodes, mf, lookupmf, units=_('manifests'),
365 reorder=reorder):
363 reorder=reorder):
@@ -377,7 +375,7 b' class cg1packer(object):'
377 linkrev = llr(r)
375 linkrev = llr(r)
378 if linkrev in needed:
376 if linkrev in needed:
379 yield filerevlog.node(r), cl.node(linkrev)
377 yield filerevlog.node(r), cl.node(linkrev)
380 fnodes[fname] = dict(genfilenodes())
378 return dict(genfilenodes())
381 return fnodes.get(fname, {})
379 return fnodes.get(fname, {})
382
380
383 for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
381 for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
@@ -901,7 +901,7 b' def archive(web, req, tmpl):'
901
901
902 ctx = webutil.changectx(web.repo, req)
902 ctx = webutil.changectx(web.repo, req)
903 pats = []
903 pats = []
904 matchfn = None
904 matchfn = scmutil.match(ctx, [])
905 file = req.form.get('file', None)
905 file = req.form.get('file', None)
906 if file:
906 if file:
907 pats = ['path:' + file[0]]
907 pats = ['path:' + file[0]]
@@ -104,6 +104,7 b' def _smtp(ui):'
104 if util.parsebool(verifycert) is not False:
104 if util.parsebool(verifycert) is not False:
105 raise util.Abort(_('invalid smtp.verifycert configuration: %s')
105 raise util.Abort(_('invalid smtp.verifycert configuration: %s')
106 % (verifycert))
106 % (verifycert))
107 verifycert = False
107 if (starttls or smtps) and verifycert:
108 if (starttls or smtps) and verifycert:
108 sslkwargs = sslutil.sslkwargs(ui, mailhost)
109 sslkwargs = sslutil.sslkwargs(ui, mailhost)
109 else:
110 else:
@@ -12,8 +12,15 b''
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
16 $ touch subrepo/sub
17 $ hg -q -R subrepo ci -Am "init subrepo"
18 $ echo "subrepo = subrepo" > .hgsub
19 $ hg add .hgsub
20 $ hg ci -m "add subrepo"
15 $ echo "[web]" >> .hg/hgrc
21 $ echo "[web]" >> .hg/hgrc
16 $ echo "name = test-archive" >> .hg/hgrc
22 $ echo "name = test-archive" >> .hg/hgrc
23 $ echo "archivesubrepos = True" >> .hg/hgrc
17 $ cp .hg/hgrc .hg/hgrc-base
24 $ cp .hg/hgrc .hg/hgrc-base
18 > test_archtype() {
25 > test_archtype() {
19 > echo "allow_archive = $1" >> .hg/hgrc
26 > echo "allow_archive = $1" >> .hg/hgrc
@@ -83,30 +90,39 b' invalid arch type should give 404'
83 > sys.stderr.write(str(e) + '\n')
90 > sys.stderr.write(str(e) + '\n')
84 > EOF
91 > EOF
85 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
92 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
86 test-archive-2c0277f05ed4/.hg_archival.txt
93 test-archive-1701ef1f1510/.hg_archival.txt
87 test-archive-2c0277f05ed4/bar
94 test-archive-1701ef1f1510/.hgsub
88 test-archive-2c0277f05ed4/baz/bletch
95 test-archive-1701ef1f1510/.hgsubstate
89 test-archive-2c0277f05ed4/foo
96 test-archive-1701ef1f1510/bar
97 test-archive-1701ef1f1510/baz/bletch
98 test-archive-1701ef1f1510/foo
99 test-archive-1701ef1f1510/subrepo/sub
90 $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
100 $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
91 test-archive-2c0277f05ed4/.hg_archival.txt
101 test-archive-1701ef1f1510/.hg_archival.txt
92 test-archive-2c0277f05ed4/bar
102 test-archive-1701ef1f1510/.hgsub
93 test-archive-2c0277f05ed4/baz/bletch
103 test-archive-1701ef1f1510/.hgsubstate
94 test-archive-2c0277f05ed4/foo
104 test-archive-1701ef1f1510/bar
105 test-archive-1701ef1f1510/baz/bletch
106 test-archive-1701ef1f1510/foo
107 test-archive-1701ef1f1510/subrepo/sub
95 $ python getarchive.py "$TIP" zip > archive.zip
108 $ python getarchive.py "$TIP" zip > archive.zip
96 $ unzip -t archive.zip
109 $ unzip -t archive.zip
97 Archive: archive.zip
110 Archive: archive.zip
98 testing: test-archive-2c0277f05ed4/.hg_archival.txt OK
111 testing: test-archive-1701ef1f1510/.hg_archival.txt OK
99 testing: test-archive-2c0277f05ed4/bar OK
112 testing: test-archive-1701ef1f1510/.hgsub OK
100 testing: test-archive-2c0277f05ed4/baz/bletch OK
113 testing: test-archive-1701ef1f1510/.hgsubstate OK
101 testing: test-archive-2c0277f05ed4/foo OK
114 testing: test-archive-1701ef1f1510/bar OK
115 testing: test-archive-1701ef1f1510/baz/bletch OK
116 testing: test-archive-1701ef1f1510/foo OK
117 testing: test-archive-1701ef1f1510/subrepo/sub OK
102 No errors detected in compressed data of archive.zip.
118 No errors detected in compressed data of archive.zip.
103
119
104 test that we can download single directories and files
120 test that we can download single directories and files
105
121
106 $ 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
107 test-archive-2c0277f05ed4/baz/bletch
123 test-archive-1701ef1f1510/baz/bletch
108 $ 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
109 test-archive-2c0277f05ed4/foo
125 test-archive-1701ef1f1510/foo
110
126
111 test that we detect file patterns that match no files
127 test that we detect file patterns that match no files
112
128
@@ -123,29 +139,39 b' test that we reject unsafe patterns'
123 $ hg archive -t tar test.tar
139 $ hg archive -t tar test.tar
124 $ tar tf test.tar
140 $ tar tf test.tar
125 test/.hg_archival.txt
141 test/.hg_archival.txt
142 test/.hgsub
143 test/.hgsubstate
126 test/bar
144 test/bar
127 test/baz/bletch
145 test/baz/bletch
128 test/foo
146 test/foo
129
147
130 $ hg archive --debug -t tbz2 -X baz test.tar.bz2
148 $ hg archive --debug -t tbz2 -X baz test.tar.bz2
131 archiving: 0/2 files (0.00%)
149 archiving: 0/4 files (0.00%)
132 archiving: bar 1/2 files (50.00%)
150 archiving: .hgsub 1/4 files (25.00%)
133 archiving: foo 2/2 files (100.00%)
151 archiving: .hgsubstate 2/4 files (50.00%)
152 archiving: bar 3/4 files (75.00%)
153 archiving: foo 4/4 files (100.00%)
134 $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
154 $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
135 test/.hg_archival.txt
155 test/.hg_archival.txt
156 test/.hgsub
157 test/.hgsubstate
136 test/bar
158 test/bar
137 test/foo
159 test/foo
138
160
139 $ hg archive -t tgz -p %b-%h test-%h.tar.gz
161 $ hg archive -t tgz -p %b-%h test-%h.tar.gz
140 $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
162 $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
141 test-2c0277f05ed4/.hg_archival.txt
163 test-1701ef1f1510/.hg_archival.txt
142 test-2c0277f05ed4/bar
164 test-1701ef1f1510/.hgsub
143 test-2c0277f05ed4/baz/bletch
165 test-1701ef1f1510/.hgsubstate
144 test-2c0277f05ed4/foo
166 test-1701ef1f1510/bar
167 test-1701ef1f1510/baz/bletch
168 test-1701ef1f1510/foo
145
169
146 $ hg archive autodetected_test.tar
170 $ hg archive autodetected_test.tar
147 $ tar tf autodetected_test.tar
171 $ tar tf autodetected_test.tar
148 autodetected_test/.hg_archival.txt
172 autodetected_test/.hg_archival.txt
173 autodetected_test/.hgsub
174 autodetected_test/.hgsubstate
149 autodetected_test/bar
175 autodetected_test/bar
150 autodetected_test/baz/bletch
176 autodetected_test/baz/bletch
151 autodetected_test/foo
177 autodetected_test/foo
@@ -155,6 +181,8 b" The '-t' should override autodetection"
155 $ hg archive -t tar autodetect_override_test.zip
181 $ hg archive -t tar autodetect_override_test.zip
156 $ tar tf autodetect_override_test.zip
182 $ tar tf autodetect_override_test.zip
157 autodetect_override_test.zip/.hg_archival.txt
183 autodetect_override_test.zip/.hg_archival.txt
184 autodetect_override_test.zip/.hgsub
185 autodetect_override_test.zip/.hgsubstate
158 autodetect_override_test.zip/bar
186 autodetect_override_test.zip/bar
159 autodetect_override_test.zip/baz/bletch
187 autodetect_override_test.zip/baz/bletch
160 autodetect_override_test.zip/foo
188 autodetect_override_test.zip/foo
@@ -203,10 +231,12 b' rename them afterwards.'
203 No errors detected in compressed data of test.zip.
231 No errors detected in compressed data of test.zip.
204
232
205 $ hg archive -t tar - | tar tf - 2>/dev/null
233 $ hg archive -t tar - | tar tf - 2>/dev/null
206 test-2c0277f05ed4/.hg_archival.txt
234 test-1701ef1f1510/.hg_archival.txt
207 test-2c0277f05ed4/bar
235 test-1701ef1f1510/.hgsub
208 test-2c0277f05ed4/baz/bletch
236 test-1701ef1f1510/.hgsubstate
209 test-2c0277f05ed4/foo
237 test-1701ef1f1510/bar
238 test-1701ef1f1510/baz/bletch
239 test-1701ef1f1510/foo
210
240
211 $ hg archive -r 0 -t tar rev-%r.tar
241 $ hg archive -r 0 -t tar rev-%r.tar
212 $ [ -f rev-0.tar ]
242 $ [ -f rev-0.tar ]
@@ -216,10 +246,10 b' test .hg_archival.txt'
216 $ hg archive ../test-tags
246 $ hg archive ../test-tags
217 $ cat ../test-tags/.hg_archival.txt
247 $ cat ../test-tags/.hg_archival.txt
218 repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
248 repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
219 node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
249 node: 1701ef1f151069b8747038e93b5186bb43a47504
220 branch: default
250 branch: default
221 latesttag: null
251 latesttag: null
222 latesttagdistance: 3
252 latesttagdistance: 4
223 $ hg tag -r 2 mytag
253 $ hg tag -r 2 mytag
224 $ hg tag -r 2 anothertag
254 $ hg tag -r 2 anothertag
225 $ hg archive -r 2 ../test-lasttag
255 $ hg archive -r 2 ../test-lasttag
@@ -250,16 +280,20 b' enable progress extension:'
250
280
251 $ hg archive ../with-progress
281 $ hg archive ../with-progress
252 \r (no-eol) (esc)
282 \r (no-eol) (esc)
253 archiving [ ] 0/4\r (no-eol) (esc)
283 archiving [ ] 0/6\r (no-eol) (esc)
254 archiving [ ] 0/4\r (no-eol) (esc)
284 archiving [ ] 0/6\r (no-eol) (esc)
255 archiving [=========> ] 1/4\r (no-eol) (esc)
285 archiving [======> ] 1/6\r (no-eol) (esc)
256 archiving [=========> ] 1/4\r (no-eol) (esc)
286 archiving [======> ] 1/6\r (no-eol) (esc)
257 archiving [====================> ] 2/4\r (no-eol) (esc)
287 archiving [=============> ] 2/6\r (no-eol) (esc)
258 archiving [====================> ] 2/4\r (no-eol) (esc)
288 archiving [=============> ] 2/6\r (no-eol) (esc)
259 archiving [===============================> ] 3/4\r (no-eol) (esc)
289 archiving [====================> ] 3/6\r (no-eol) (esc)
260 archiving [===============================> ] 3/4\r (no-eol) (esc)
290 archiving [====================> ] 3/6\r (no-eol) (esc)
261 archiving [==========================================>] 4/4\r (no-eol) (esc)
291 archiving [===========================> ] 4/6\r (no-eol) (esc)
262 archiving [==========================================>] 4/4\r (no-eol) (esc)
292 archiving [===========================> ] 4/6\r (no-eol) (esc)
293 archiving [==================================> ] 5/6\r (no-eol) (esc)
294 archiving [==================================> ] 5/6\r (no-eol) (esc)
295 archiving [==========================================>] 6/6\r (no-eol) (esc)
296 archiving [==========================================>] 6/6\r (no-eol) (esc)
263 \r (no-eol) (esc)
297 \r (no-eol) (esc)
264
298
265 cleanup after progress extension test:
299 cleanup after progress extension test:
General Comments 0
You need to be logged in to leave comments. Login now