Mercurial > public > mercurial-scm > hg
comparison mercurial/dirstate.py @ 23629:a04c7b74b3d5
ignore: resolve ignore files relative to repo root (issue4473) (BC)
Previously these would be considered to be relative to the current working
directory. That behavior is both undocumented and doesn't really make sense.
There are two reasonable options for how to resolve relative paths:
- relative to the repo root
- relative to the config file
Resolving these files relative to the repo root matches existing behavior with
hooks. An earlier discussion about this is available at
http://mercurial.markmail.org/thread/tvu7yhzsiywgkjzl.
Thanks to Isaac Jurado <diptongo@gmail.com> for the initial patchset that
spurred the discussion.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 16 Dec 2014 14:34:53 -0800 |
parents | ee5a4ed4c8b1 |
children | 9dd442148301 |
comparison
equal
deleted
inserted
replaced
23628:7d7a4848fff4 | 23629:a04c7b74b3d5 |
---|---|
128 @rootcache('.hgignore') | 128 @rootcache('.hgignore') |
129 def _ignore(self): | 129 def _ignore(self): |
130 files = [self._join('.hgignore')] | 130 files = [self._join('.hgignore')] |
131 for name, path in self._ui.configitems("ui"): | 131 for name, path in self._ui.configitems("ui"): |
132 if name == 'ignore' or name.startswith('ignore.'): | 132 if name == 'ignore' or name.startswith('ignore.'): |
133 files.append(util.expandpath(path)) | 133 # we need to use os.path.join here rather than self._join |
134 # because path is arbitrary and user-specified | |
135 files.append(os.path.join(self._rootdir, util.expandpath(path))) | |
134 return ignore.ignore(self._root, files, self._ui.warn) | 136 return ignore.ignore(self._root, files, self._ui.warn) |
135 | 137 |
136 @propertycache | 138 @propertycache |
137 def _slash(self): | 139 def _slash(self): |
138 return self._ui.configbool('ui', 'slash') and os.sep != '/' | 140 return self._ui.configbool('ui', 'slash') and os.sep != '/' |