Mercurial > hg
comparison mercurial/match.py @ 25875:511e1949d557 stable
ignore: fix path concatenation of .hgignore on Windows
Since 3de48ff62733, .hgignore is ignored on Windows because a pat may have
a drive letter, but pathutil.join is posixpath.join.
"z:\foo\bar/z:\foo\bar\.hgignore"
Instead, this patch uses os.path.join() and util.localpath() to process both
parts as file-system paths.
Maybe we can remove os.path.join() at dirstate._ignore because 'include:' is
resolved relative to repo root? It was introduced by a04c7b74b3d5.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 27 Jul 2015 22:14:40 +0900 |
parents | 3de48ff62733 |
children | c4ccf2d394a7 9ac4e81b9659 |
comparison
equal
deleted
inserted
replaced
25874:3e84f40232c7 | 25875:511e1949d557 |
---|---|
3 # Copyright 2008, 2009 Matt Mackall <mpm@selenic.com> and others | 3 # Copyright 2008, 2009 Matt Mackall <mpm@selenic.com> and others |
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 import copy, re | 8 import copy, os, re |
9 import util, pathutil | 9 import util, pathutil |
10 from i18n import _ | 10 from i18n import _ |
11 | 11 |
12 propertycache = util.propertycache | 12 propertycache = util.propertycache |
13 | 13 |
287 auditor): | 287 auditor): |
288 kindpats.append((k, p, pat)) | 288 kindpats.append((k, p, pat)) |
289 continue | 289 continue |
290 elif kind == 'include': | 290 elif kind == 'include': |
291 try: | 291 try: |
292 fullpath = pathutil.join(root, pat) | 292 fullpath = os.path.join(root, util.localpath(pat)) |
293 includepats = readpatternfile(fullpath, self._warn) | 293 includepats = readpatternfile(fullpath, self._warn) |
294 for k, p, source in self._normalize(includepats, default, | 294 for k, p, source in self._normalize(includepats, default, |
295 root, cwd, auditor): | 295 root, cwd, auditor): |
296 kindpats.append((k, p, source or pat)) | 296 kindpats.append((k, p, source or pat)) |
297 except util.Abort as inst: | 297 except util.Abort as inst: |