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.
changegroup: don't use 'repo' for non-repo 'self'
'repo' is a very confusing name to use for 'self', especially when
it's not a repo. Also drop repo.ui member (a.k.a. self.ui) now that
'self' doesn't shadow outer 'repo' variable.
subrepo: introduce hgsubrepo._getctx()
This code is already used in a couple of places, and will need to be used in
others where wdir() support is needed. Trying to get the wdir() revision stored
in self._substate[1] when creating the object in subrepo.subrepo() resulted in
breaking various status and diff tests. This is a far less invasive change.