# HG changeset patch # User Jesse Glick # Date 1199850051 18000 # Node ID ffaf2419de448b9332420c40a85d2381e70af3fb # Parent d8878742a924157e0dfb04644d46e79878797bfb Ensure that absolutized paths from hgrc do not contain ../ segments. diff -r d8878742a924 -r ffaf2419de44 mercurial/ui.py --- a/mercurial/ui.py Fri Jan 25 16:18:49 2008 +0100 +++ b/mercurial/ui.py Tue Jan 08 22:40:51 2008 -0500 @@ -204,7 +204,8 @@ pathsitems = items for n, path in pathsitems: if path and "://" not in path and not os.path.isabs(path): - cdata.set("paths", n, os.path.join(root, path)) + cdata.set("paths", n, + os.path.normpath(os.path.join(root, path))) # update verbosity/interactive/report_untrusted settings if section is None or section == 'ui': diff -r d8878742a924 -r ffaf2419de44 tests/test-keyword.out --- a/tests/test-keyword.out Fri Jan 25 16:18:49 2008 +0100 +++ b/tests/test-keyword.out Tue Jan 08 22:40:51 2008 -0500 @@ -293,7 +293,7 @@ added 1 changesets with 3 changes to 3 files 3 files updated, 0 files merged, 0 files removed, 0 files unresolved % incoming -comparing with test-keyword/Test-a/../Test +comparing with test-keyword/Test searching for changes changeset: 1:0729690beff6 tag: tip diff -r d8878742a924 -r ffaf2419de44 tests/test-paths --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-paths Tue Jan 08 22:40:51 2008 -0500 @@ -0,0 +1,11 @@ +#!/bin/sh +base=`pwd` +hg init a +hg clone a b +cd a +echo '[paths]' >> .hg/hgrc +echo 'dupe = ../b' >> .hg/hgrc +hg in dupe | sed "s!$base!!g" +cd .. +hg -R a in dupe | sed "s!$base!!g" +true diff -r d8878742a924 -r ffaf2419de44 tests/test-paths.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-paths.out Tue Jan 08 22:40:51 2008 -0500 @@ -0,0 +1,5 @@ +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +comparing with /b +no changes found +comparing with /b +no changes found