# HG changeset patch # User Jun Inoue # Date 1171523903 7200 # Node ID cc8a52229620dbc4f629c6c35648beaee0329872 # Parent ef14fdb675da80b6e65baccb4054c918448386eb Fix accessing the repo through a symlink. diff -r ef14fdb675da -r cc8a52229620 mercurial/util.py --- a/mercurial/util.py Tue Feb 13 10:02:07 2007 -0200 +++ b/mercurial/util.py Thu Feb 15 05:18:23 2007 -0200 @@ -363,6 +363,9 @@ except OSError: break if samestat(name_st, root_st): + if not rel: + # name was actually the same as root (maybe a symlink) + return '' rel.reverse() name = os.path.join(*rel) audit_path(name) diff -r ef14fdb675da -r cc8a52229620 tests/test-symlink-root --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-symlink-root Thu Feb 15 05:18:23 2007 -0200 @@ -0,0 +1,8 @@ +#!/bin/sh + +hg init a +ln -s a link +cd a +echo foo > foo +hg status +hg status ../link diff -r ef14fdb675da -r cc8a52229620 tests/test-symlink-root.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-symlink-root.out Thu Feb 15 05:18:23 2007 -0200 @@ -0,0 +1,2 @@ +? foo +? foo