# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1326032606 -3600 # Node ID c7a8164c61ab6575e09ce2ea6593c5a28627e554 # Parent 3e5b6045ccfc49d96595317dfbf1b259aa12f0de canonpath: allow canonicalization of non-existant paths Such as a copy destination; see the added test. diff -r 3e5b6045ccfc -r c7a8164c61ab mercurial/scmutil.py --- a/mercurial/scmutil.py Sun Jan 08 14:33:10 2012 +0100 +++ b/mercurial/scmutil.py Sun Jan 08 15:23:26 2012 +0100 @@ -313,8 +313,8 @@ try: name_st = os.stat(name) except OSError: - break - if util.samestat(name_st, root_st): + name_st = None + if name_st and util.samestat(name_st, root_st): if not rel: # name was actually the same as root (maybe a symlink) return '' diff -r 3e5b6045ccfc -r c7a8164c61ab tests/test-symlinks.t --- a/tests/test-symlinks.t Sun Jan 08 14:33:10 2012 +0100 +++ b/tests/test-symlinks.t Sun Jan 08 15:23:26 2012 +0100 @@ -168,11 +168,12 @@ ? foo $ hg status ../link ? foo + $ hg add foo + $ hg cp foo "$TESTTMP/link/bar" + foo has not been committed yet, so no copy data will be stored for bar. $ cd .. - - $ hg init b $ cd b $ ln -s nothing dangling