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