--- a/mercurial/archival.py Wed Dec 15 16:35:09 2010 +0100
+++ b/mercurial/archival.py Mon Nov 29 16:17:05 2010 +0100
@@ -262,9 +262,14 @@
write('.hg_archival.txt', 0644, False, metadata)
- for f in ctx:
+ total = len(ctx.manifest())
+ repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total)
+ for i, f in enumerate(ctx):
ff = ctx.flags(f)
write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data)
+ repo.ui.progress(_('archiving'), i + 1, item=f,
+ unit=_('files'), total=total)
+ repo.ui.progress(_('archiving'), None)
if subrepos:
for subpath in ctx.substate:
--- a/tests/test-archive.t Wed Dec 15 16:35:09 2010 +0100
+++ b/tests/test-archive.t Mon Nov 29 16:17:05 2010 +0100
@@ -206,6 +206,37 @@
abort: unknown archive type 'bogus'
[255]
+enable progress extension:
+
+ $ cp $HGRCPATH $HGRCPATH.no-progress
+ $ cat >> $HGRCPATH <<EOF
+ > [extensions]
+ > progress =
+ > [progress]
+ > assume-tty = 1
+ > delay = 0
+ > refresh = 0
+ > width = 60
+ > EOF
+
+ $ hg archive ../with-progress 2>&1 | $TESTDIR/filtercr.py
+
+ archiving [ ] 0/4
+ archiving [ ] 0/4
+ archiving [=========> ] 1/4
+ archiving [=========> ] 1/4
+ archiving [====================> ] 2/4
+ archiving [====================> ] 2/4
+ archiving [===============================> ] 3/4
+ archiving [===============================> ] 3/4
+ archiving [==========================================>] 4/4
+ archiving [==========================================>] 4/4
+ \r (esc)
+
+cleanup after progress extension test:
+
+ $ cp $HGRCPATH.no-progress $HGRCPATH
+
server errors
$ cat errors.log