Mercurial > hg
comparison relnotes/next @ 42341: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 | bcb1a2b6cd00 |
children | d8e55c0c642c |
comparison
equal
deleted
inserted
replaced
42340:7ada598941d2 | 42341:27d6956d386b |
---|---|
27 | 27 |
28 | 28 |
29 == Internal API Changes == | 29 == Internal API Changes == |
30 | 30 |
31 * Matchers are no longer iterable. Use `match.files()` instead. | 31 * Matchers are no longer iterable. Use `match.files()` instead. |
32 | |
33 * `match.visitdir()` and `match.visitchildrenset()` now expect the | |
34 empty string instead of '.' to indicate the root directory. |