[PATCH] dirstate: use repository root as base for relative paths read from ui.ignore
diptongo at gmail.com
diptongo at gmail.com
Thu Apr 18 14:56:48 CDT 2013
# HG changeset patch
# User Isaac Jurado <diptongo at gmail.com>
# Date 1366314160 -7200
# Thu Apr 18 21:42:40 2013 +0200
# Node ID 380de75c43f4a186a1b8255393cf52c3af43820a
# Parent 7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
dirstate: use repository root as base for relative paths read from ui.ignore
Convert relative paths from the ui.ignore* configurations to absolute by
prepending the path to the repository root. This breaks the old, and probably
unused, behaviour where relative paths were interpreted from the working
directory.
Absolute paths are kept untouched.
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -103,7 +103,11 @@
files = [self._join('.hgignore')]
for name, path in self._ui.configitems("ui"):
if name == 'ignore' or name.startswith('ignore.'):
- files.append(util.expandpath(path))
+ p = util.expandpath(path)
+ if os.path.isabs(p):
+ files.append(p)
+ else:
+ files.append(self._join(p))
return ignore.ignore(self._root, files, self._ui.warn)
@propertycache
More information about the Mercurial-devel
mailing list