hgext/progress.py
changeset 21859 be4270d27a7e
parent 19619 4694ccd5d994
child 21860 e382cf9ec30b
--- a/hgext/progress.py	Sun Jul 06 02:56:41 2014 +0900
+++ b/hgext/progress.py	Sun Jul 06 02:56:41 2014 +0900
@@ -41,6 +41,8 @@
 from mercurial.i18n import _
 testedwith = 'internal'
 
+from mercurial import encoding
+
 def spacejoin(*args):
     return ' '.join(s for s in args if s)
 
@@ -180,7 +182,7 @@
             out = spacejoin(head, prog, tail)
         else:
             out = spacejoin(head, tail)
-        sys.stderr.write('\r' + out[:termwidth])
+        sys.stderr.write('\r' + encoding.trim(out, termwidth))
         self.lasttopic = topic
         sys.stderr.flush()