parsers: factor out code to create a presized dict
In upcoming patches we'll expose this as an API.
progress: respect ui.quiet (
issue4726)
Caught when I was running the hgsubversion testsuite and it started
printing progress bars over top of my test output lines.
match: don't remove '.' from _includeroots
This makes _includeroots more like _fileroots and gives visitdir() a
nice symmetry in the two.
I'm hoping to later combine the two (_fileroots and _includeroots),
and having them treated similarly should make that step easier to
follow.
match: join two nested if-blocks
Instead of
if a:
if b:
return False
let's write it
if a and b:
return False
match: drop optimization (?) of 'parentdirs' calculation
It seems unlikely that the optimization to avoid calling util.finddirs
twice will be noticeable, so let's drop it. This makes the two
conditions for includes and regular patterns more similar.
match: break boolean expressions into one operand per line
This makes it much easier to spot both the operators ('and'/'or') and
the operands.
match: drop unnecessary removal of '.' from excluded roots
The repo root is nothing special when it comes to what directories to
visit: patterns like '-X relglob:*.py' should not exclude the top
directory, while '-X path:.' should (pointless as such a pattern may
be). The explicit removal of '.' from the set of excluded roots was
probably there to avoid removing the the root directory when any
patterns had been given, but since
20ad936ac5d2 (treemanifest: visit
directory 'foo' when given e.g. '-X foo/ba?', 2015-05-27), we only
exclude directories that should be completely excluded, so we no
longer need to special-case the root directory.
changegroup: simplify by not reusing 'prog(ress)' instance
Just create a new instance of the 'prog' class for each step instead
of replacing its fields and resetting the counter.