Skip to content
Snippets Groups Projects
Commit 511e1949 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

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.
parent 3e84f402
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import copy, re
import copy, os, re
import util, pathutil
from i18n import _
......@@ -289,7 +289,7 @@
continue
elif kind == 'include':
try:
fullpath = pathutil.join(root, pat)
fullpath = os.path.join(root, util.localpath(pat))
includepats = readpatternfile(fullpath, self._warn)
for k, p, source in self._normalize(includepats, default,
root, cwd, auditor):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment