diff --git a/mercurial/progress.py b/mercurial/progress.py --- a/mercurial/progress.py +++ b/mercurial/progress.py @@ -163,7 +163,7 @@ class progbar(object): sys.stderr.flush() def clear(self): - if not shouldprint(self.ui): + if not self.printed or not self.lastprint or not shouldprint(self.ui): return sys.stderr.write('\r%s\r' % (' ' * self.width())) if self.printed: diff --git a/tests/test-remove.t b/tests/test-remove.t --- a/tests/test-remove.t +++ b/tests/test-remove.t @@ -322,8 +322,6 @@ dir, options none \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) - \r (no-eol) (esc) - \r (no-eol) (esc) removing test/bar (glob) removing test/foo (glob) exit code: 0 @@ -348,8 +346,6 @@ dir, options -f \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) - \r (no-eol) (esc) - \r (no-eol) (esc) removing test/bar (glob) removing test/foo (glob) exit code: 0 @@ -374,8 +370,6 @@ dir, options -A \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) - \r (no-eol) (esc) - \r (no-eol) (esc) removing test/bar (glob) not removing test/foo: file still exists (glob) exit code: 1 @@ -400,8 +394,6 @@ dir, options -Af \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) - \r (no-eol) (esc) - \r (no-eol) (esc) removing test/bar (glob) removing test/foo (glob) exit code: 0 @@ -429,8 +421,6 @@ test remove dropping empty trees (issue1 \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) - \r (no-eol) (esc) - \r (no-eol) (esc) removing issue1861/b/c/y (glob) $ hg ci -m remove $ ls issue1861 @@ -465,8 +455,6 @@ handling of untracked directories and mi \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) - \r (no-eol) (esc) - \r (no-eol) (esc) removing d1/a (glob) $ hg rm --after nosuch diff --git a/tests/test-subrepo-deep-nested-change.t b/tests/test-subrepo-deep-nested-change.t --- a/tests/test-subrepo-deep-nested-change.t +++ b/tests/test-subrepo-deep-nested-change.t @@ -214,8 +214,6 @@ Check that deep archiving works \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) - \r (no-eol) (esc) - \r (no-eol) (esc) removing sub1/sub2/folder/test.txt (glob) removing sub1/sub2/test.txt (glob) $ hg status -S