From patchwork Thu Apr 18 19:44:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: dirstate: use repository root as base for relative paths read from ui.ignore From: Isaac Jurado X-Patchwork-Id: 1434 Message-Id: To: mercurial-devel@selenic.com Date: Thu, 18 Apr 2013 21:44:38 +0200 # HG changeset patch # User Isaac Jurado # Date 1366314160 -7200 # Thu Apr 18 21:42:40 2013 +0200 # Node ID c4a3d2a6e960ab272f53add8d894e5fe8deb194a # 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. Files containing additional ignore rules are added with the ignore configuration option 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