diff mercurial/match.py @ 25870:3de48ff62733 stable

ignore: fix include: rules depending on current directory (issue4759) When reading pattern files, we just call open(path), which is relative to the current directory. Let's fix this by resolving the paths before attempting to read the file.
author Durham Goode <durham@fb.com>
date Fri, 24 Jul 2015 16:44:52 -0700
parents ff5172c83002
children 511e1949d557
line wrap: on
line diff
--- a/mercurial/match.py	Fri Jul 24 16:43:21 2015 -0700
+++ b/mercurial/match.py	Fri Jul 24 16:44:52 2015 -0700
@@ -289,7 +289,8 @@
                 continue
             elif kind == 'include':
                 try:
-                    includepats = readpatternfile(pat, self._warn)
+                    fullpath = pathutil.join(root, pat)
+                    includepats = readpatternfile(fullpath, self._warn)
                     for k, p, source in self._normalize(includepats, default,
                                                         root, cwd, auditor):
                         kindpats.append((k, p, source or pat))