[PATCH 2 of 4] convert/progress: suppress convert message output when progress is active
Augie Fackler
durin42 at gmail.com
Tue Oct 19 12:48:29 CDT 2010
# HG changeset patch
# User timeless <timeless at gmail.com>
# Date 1287475752 -10800
# Node ID 320cc52c723cd3ed845feaea1407dbdbd06100e8
# Parent 940e3790265a185fb6e63b57b29cb4f17f0d65e9
convert/progress: suppress convert message output when progress is active
Based on a patch from timeless.
diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -18,7 +18,7 @@
import filemap
import os, shutil
-from mercurial import hg, util, encoding
+from mercurial import hg, util, encoding, extensions
from mercurial.i18n import _
orig_encoding = 'ascii'
@@ -352,8 +352,10 @@
# convert log message to local encoding without using
# tolocal() because encoding.encoding conver() use it as
# 'utf-8'
- self.ui.status("%d %s\n" % (num, recode(desc)))
- self.ui.note(_("source: %s\n") % recode(c))
+
+ if 'progress' not in extensions.enabled():
+ self.ui.status("%d %s\n" % (num, recode(desc)))
+ self.ui.note(_("source: %s\n") % recode(c))
self.ui.progress(_('converting'), i, unit=_('revisions'),
total=len(t))
self.copy(c)
diff --git a/tests/test-convert-svn-move.t b/tests/test-convert-svn-move.t
--- a/tests/test-convert-svn-move.t
+++ b/tests/test-convert-svn-move.t
@@ -1,4 +1,3 @@
-
$ "$TESTDIR/hghave" svn svn-bindings || exit 80
$ fixpath()
@@ -7,7 +6,7 @@
> }
$ cat > $HGRCPATH <<EOF
> [extensions]
- > convert =
+ > convert =
> graphlog =
> EOF
@@ -77,6 +76,7 @@
o 0 createtrunk files:
+
Check move copy records
$ hg st --rev 12:13 --copies
@@ -146,7 +146,7 @@
$ cat >> $HGRCPATH <<EOF
> [extensions]
- > progress =
+ > progress =
> [progress]
> assume-tty = 1
> delay = 0
@@ -167,30 +167,12 @@
scanning [ <=> ] 4
converting [ ] 0/4
- getting files [==========> ] 1/5
- getting files [======================> ] 2/5
- getting files [==================================> ] 3/5
- getting files [==============================================> ] 4/5
- getting files [==========================================================>] 5/5
converting [==============> ] 1/4
- scanning paths [ ] 0/1
-
- getting files [==========================================================>] 1/1
converting [==============================> ] 2/4
- scanning paths [ ] 0/2
- scanning paths [============================> ] 1/2
-
- getting files [=============> ] 1/4
- getting files [============================> ] 2/4
- getting files [===========================================> ] 3/4
- getting files [==========================================================>] 4/4
converting [=============================================> ] 3/4
- scanning paths [ ] 0/1
-
- getting files [==========================================================>] 1/1
initializing destination hg-progress repository
scanning source...
More information about the Mercurial-devel
mailing list