Patchwork [1,of,2] ignore: interpret ui.ignore reltive paths from repository root

login
register
mail settings
Submitter Isaac Jurado
Date Sept. 11, 2013, 10:29 p.m.
Message ID <d0fab8d442d448c63039.1378938580@findus>
Download mbox | patch
Permalink /patch/2427/
State Deferred
Headers show

Comments

Isaac Jurado - Sept. 11, 2013, 10:29 p.m.
# HG changeset patch
# User Isaac Jurado <diptongo@gmail.com>
# Date 1378938389 -7200
#      Thu Sep 12 00:26:29 2013 +0200
# Node ID d0fab8d442d448c630394e7ea0a01c5c0308b340
# Parent  79e5de2bfa8cd18e81e71fbba1a62eee15b5e354
ignore: interpret ui.ignore reltive paths from repository root

This breaks previous, undocumented, behaviour.  Before this, relative paths in
the ui.ignore.* config options are taken relative to the current working
directory.  This is of very little use and, furthermore, it can be emulated with
the use of the $PWD environment variable (or Windows equivalent).

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -104,7 +104,8 @@ 
         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)
+                files.append(os.path.isabs(p) and p or self._join(p))
         return ignore.ignore(self._root, files, self._ui.warn)
 
     @propertycache