##// END OF EJS Templates
archive: add support for progress extension
Martin Geisler -
r13143:c2e55c21 default
parent child Browse files
Show More
@@ -262,9 +262,14 b' def archive(repo, dest, node, kind, deco'
262
262
263 write('.hg_archival.txt', 0644, False, metadata)
263 write('.hg_archival.txt', 0644, False, metadata)
264
264
265 for f in ctx:
265 total = len(ctx.manifest())
266 repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total)
267 for i, f in enumerate(ctx):
266 ff = ctx.flags(f)
268 ff = ctx.flags(f)
267 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data)
269 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data)
270 repo.ui.progress(_('archiving'), i + 1, item=f,
271 unit=_('files'), total=total)
272 repo.ui.progress(_('archiving'), None)
268
273
269 if subrepos:
274 if subrepos:
270 for subpath in ctx.substate:
275 for subpath in ctx.substate:
@@ -206,6 +206,37 b' test .hg_archival.txt'
206 abort: unknown archive type 'bogus'
206 abort: unknown archive type 'bogus'
207 [255]
207 [255]
208
208
209 enable progress extension:
210
211 $ cp $HGRCPATH $HGRCPATH.no-progress
212 $ cat >> $HGRCPATH <<EOF
213 > [extensions]
214 > progress =
215 > [progress]
216 > assume-tty = 1
217 > delay = 0
218 > refresh = 0
219 > width = 60
220 > EOF
221
222 $ hg archive ../with-progress 2>&1 | $TESTDIR/filtercr.py
223
224 archiving [ ] 0/4
225 archiving [ ] 0/4
226 archiving [=========> ] 1/4
227 archiving [=========> ] 1/4
228 archiving [====================> ] 2/4
229 archiving [====================> ] 2/4
230 archiving [===============================> ] 3/4
231 archiving [===============================> ] 3/4
232 archiving [==========================================>] 4/4
233 archiving [==========================================>] 4/4
234 \r (esc)
235
236 cleanup after progress extension test:
237
238 $ cp $HGRCPATH.no-progress $HGRCPATH
239
209 server errors
240 server errors
210
241
211 $ cat errors.log
242 $ cat errors.log
General Comments 0
You need to be logged in to leave comments. Login now