comparison hgext/sparse.py @ 33685: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
comparison
equal deleted inserted replaced
33684:2be0bf186950 33685:e1c56486d1aa
153 if sum([include, exclude, enableprofile]) > 1: 153 if sum([include, exclude, enableprofile]) > 1:
154 raise error.Abort(_("too many flags specified.")) 154 raise error.Abort(_("too many flags specified."))
155 if include or exclude or enableprofile: 155 if include or exclude or enableprofile:
156 def clonesparse(orig, self, node, overwrite, *args, **kwargs): 156 def clonesparse(orig, self, node, overwrite, *args, **kwargs):
157 sparse.updateconfig(self.unfiltered(), pat, {}, include=include, 157 sparse.updateconfig(self.unfiltered(), pat, {}, include=include,
158 exclude=exclude, enableprofile=enableprofile) 158 exclude=exclude, enableprofile=enableprofile,
159 usereporootpaths=True)
159 return orig(self, node, overwrite, *args, **kwargs) 160 return orig(self, node, overwrite, *args, **kwargs)
160 extensions.wrapfunction(hg, 'updaterepo', clonesparse) 161 extensions.wrapfunction(hg, 'updaterepo', clonesparse)
161 return orig(ui, repo, *args, **opts) 162 return orig(ui, repo, *args, **opts)
162 163
163 def _setupclone(ui): 164 def _setupclone(ui):