Mercurial > public > mercurial-scm > hg-stable
diff hgext/sparse.py @ 33711:e1c56486d1aa
sparse: treat paths as cwd-relative
This commit makes it so sparse treats passed paths as CWD-relative,
not repo-root-realive. This is a more intuitive behavior in my (and some
other FB people's) opinion.
This is breaking change however. My hope here is that since sparse is
experimental, it's ok to introduce BCs.
The reason (glob)s are needed in the test is this: in these two cases we
do not supply path together with slashes, but `os.path.join` adds them, which
means that under Windows they can be backslashes. To demonstrate this behavior,
one could remove the (glob)s and run `./run-tests.py test-sparse.t` from
MinGW's terminal on Windows.
author | Kostia Balytskyi <ikostia@fb.com> |
---|---|
date | Fri, 04 Aug 2017 05:38:22 -0700 |
parents | 1d1779734c99 |
children | d8d06a930d60 |
line wrap: on
line diff
--- a/hgext/sparse.py Wed Aug 02 15:48:57 2017 -0700 +++ b/hgext/sparse.py Fri Aug 04 05:38:22 2017 -0700 @@ -155,7 +155,8 @@ if include or exclude or enableprofile: def clonesparse(orig, self, node, overwrite, *args, **kwargs): sparse.updateconfig(self.unfiltered(), pat, {}, include=include, - exclude=exclude, enableprofile=enableprofile) + exclude=exclude, enableprofile=enableprofile, + usereporootpaths=True) return orig(self, node, overwrite, *args, **kwargs) extensions.wrapfunction(hg, 'updaterepo', clonesparse) return orig(ui, repo, *args, **opts)