Mercurial > public > mercurial-scm > hg-stable
diff mercurial/changegroup.py @ 42363:27d6956d386b
match: use '' instead of '.' for root directory (API)
I think '' is generally a better value for the root directory than '.'
is. For example, os.path.join('', 'foo') => 'foo', while
os.path.join('.', 'foo') => './foo'.
This patch mostly makes it so we use '' internally in
match.py. However, it also affects the API in visitdir(),
visitchildrenset() and files(). The two former now also accept '' as
input. I've updated the callers of these methods. I've also added a
deprecation warning for passing '.' (for external callers). The only
caller I could find that was affected by files() returning '' instead
of '.' was in dirstate.walk(). I've updated that.
The next few patches show some workarounds we can remove by using ''
instead of '.'.
Differential Revision: https://phab.mercurial-scm.org/D6401
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 15 May 2017 00:12:19 -0700 |
parents | 1c1c4ef8b72e |
children | 268662aac075 |
line wrap: on
line diff
--- a/mercurial/changegroup.py Wed Apr 24 09:32:29 2019 -0700 +++ b/mercurial/changegroup.py Mon May 15 00:12:19 2017 -0700 @@ -1061,7 +1061,7 @@ while tmfnodes: tree, nodes = tmfnodes.popitem() - should_visit = self._matcher.visitdir(tree[:-1] or '.') + should_visit = self._matcher.visitdir(tree[:-1]) if tree and not should_visit: continue @@ -1093,7 +1093,7 @@ fullclnodes=self._fullclnodes, precomputedellipsis=self._precomputedellipsis) - if not self._oldmatcher.visitdir(store.tree[:-1] or '.'): + if not self._oldmatcher.visitdir(store.tree[:-1]): yield tree, deltas else: # 'deltas' is a generator and we need to consume it even if