Commit Graph

23 Commits

Author SHA1 Message Date
Mark Thomas
e09288137b ui: deprecate ui.progress
Summary:
Remove ui.progress as a method of updating progress.  All progress bars now go
through new-style progress bars.

This also splits out the rendering of progress bars from the reporting of
progress.  All tests are updated to use new-style debug progress bars, which
simply report the position of the progress bar.  Rendering of progress bars
will be tested separately once the progress bar engine has been rewritten.

Reviewed By: quark-zju

Differential Revision: D7329488

fbshipit-source-id: 14f8ab67365ddd98b74986aa25d9abc7a0546144
2018-04-13 21:51:34 -07:00
Mark Thomas
c13d19c577 cmdutil: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329499

fbshipit-source-id: 429fd5a7c1cbbfe4734f940b74a3333cb57af455
2018-04-13 21:51:32 -07:00
Ryan McElroy
883f750613 merge: show progress when updating dirstate after update
Summary:
For large updates, the dirstate update can take a while. Let's show
progress so the user understands what is happening and how long to wait.

Reviewed By: quark-zju

Differential Revision: D6903133

fbshipit-source-id: f7f6c3c14e1d3221a383da4a6e311aa12a8d3a98
2018-04-13 21:51:21 -07:00
Matt Harbison
7d8bebd9c1 tests: remove (glob) annotations that were only for '\' matches
# skip-blame because this was mechanically rewritten the following script.  I
ran it on both *.t and *.py, but none of the *.py changes were proper.  All *.t
ones appear to be, and they run without addition failures on both Windows and
Linux.

  import argparse
  import os
  import re

  ap = argparse.ArgumentParser()
  ap.add_argument('path', nargs='+')
  opts = ap.parse_args()

  globre = re.compile(r'^(.*) \(glob\)(.*)$')

  for p in opts.path:
      tmp = p + '.tmp'
      with open(p, 'rb') as src, open(tmp, 'wb') as dst:
          for line in src:
              m = globre.match(line)
              if not m or '$LOCALIP' in line or '*' in line:
                  dst.write(line)
                  continue
              if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
                  dst.write(line)
                  continue
              dst.write(m.group(1) + m.group(2) + '\n')
      os.unlink(p)
      os.rename(tmp, p)
2017-12-10 22:50:57 -05:00
pavanpc@fb.com
a3ed13f083 remove: print message for each file in verbose mode only while using -A (BC)
hg rm -A option prints the message of every file in the repo. This is not very
user friendly for a big repository with thousands of files. So enabling this
feature only when run in --verbose mode (hg rm -Av)

Differential Revision: https://phab.mercurial-scm.org/D1336
2017-11-17 22:52:40 +00:00
timeless
9b9d2357c6 remove: specify hg in added warning 2016-09-02 21:46:00 +00:00
Matt Mackall
8568a2cad9 progress: stop excessive clearing (issue4801)
The progress bar was being cleared on every write(), regardless of
whether it was currently displayed. This could foul up the display of
any writes that didn't include a linebreak.

In particular, the win32 mode of the color extension was turning
single prompt string writes into two writes, and the resulting
clear/write/clear/write pattern was making the prompt invisible.

We fix this by insisting that we have shown a progress bar and haven't
just cleared it (setting lastprint to 0).

Conveniently, the test suite already had instances of duplicate
clears.. that are now cleared up.
2016-05-06 17:53:06 -05:00
Matt Harbison
6416635956 test-remove: drop a useless Windows specific conditional
The Windows branch didn't pick up the 'deleting' progress bar addition from
fbfaef28d47c.  But since the Windows branch already globbed the error message,
let's just drop the other branch.
2016-04-12 00:34:02 -04:00
timeless
9ba351b1ab remove: add progress support 2016-03-17 21:03:22 +00:00
timeless
f5abb39053 remove: queue warnings until after status messages (issue5140) (API)
Before this change, warnings were interspersed with (and easily drowned out by)
status messages.

API:
abstractsubrepo.removefiles has an extra argument warnings,
into which callees should append their warnings.
  Note: Callees should not assume that there will be items in the list,
  today, I'm lazily including any other subrepos warnings, but
  that may change.

cmdutil.remove has an extra optional argument warnings,
into which it will place warnings.
If warnings is omitted, warnings will be reported via ui.warn()
as before this change (albeit, after any status messages).
2016-03-17 18:19:36 +00:00
timeless
31b015dd64 tests: include progress for test-remove 2016-03-21 04:01:29 +00:00
Simon Heimberg
180e520fa6 tests: do not skip code-checking on some whole files
In filterpyflakes the term no-check-code was probably by accident.
In the test the intention was not to skip the entire file but only one
line. But any skipping seems to be unnecessary since a longer time.
2013-07-01 06:50:58 +02:00
Mads Kiilerich
00be1ef6f3 rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
A warning mentioning 'forgetting' or 'recording delete' would be more correct
than 'not removing' but also more confusing.
2012-12-09 23:33:16 +01:00
Adrian Buehlmann
5b12c1cd53 test-remove: adapt to differing error message on Windows
On Windows, this part of the test failed with

     $ hg rm --after nosuch
  -  nosuch: No such file or directory
  +  nosuch: The system cannot find the file specified
     [1]

Fixed by glob-ing away the error message if the test is run on Windows
(see for example test-bad-pull.t line 3 for precedent).

test-remove.t now passes on Windows.
2012-10-24 11:51:24 +02:00
Adrian Buehlmann
36604dded8 test-remove: fix \ vs. / issues on Windows
This part of the test failed with

     $ hg rm --after d1
  -  removing d1/a
  +  removing d1\a

on Windows.
2012-10-24 11:38:31 +02:00
Matt Mackall
f5bc386500 remove: don't return error on directories with tracked files
Spotted by Sergey <sergemp@mail.ru>
2012-10-22 16:06:47 -05:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Adrian Buehlmann
c425afcd4c test-remove-new: integrate into test-remove.t 2012-06-10 18:28:42 +02:00
Mads Kiilerich
8c22a0ec28 tests: make (glob) on windows accept \ instead of /
Globbing is usually used for filenames, so on windows it is reasonable and very
convenient that glob patterns accepts '\' or '/' when the pattern specifies
'/'.
2011-11-07 03:25:10 +01:00
Matt Mackall
35b02109ec remove: suggest forget to undo adds 2011-09-16 17:53:58 -05:00
Matt Mackall
ac660e9f65 tests: cleanup exit code handling in unified tests 2010-09-21 16:00:02 -05:00
Martin Geisler
516e74e526 merge with stable 2010-09-01 12:28:34 +02:00
Nicolas Dumazet
789cb13602 tests: unify test-remove 2010-08-30 13:02:54 +09:00