Skip to content
Snippets Groups Projects
Commit c7a8164c61ab authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

canonpath: allow canonicalization of non-existant paths

Such as a copy destination; see the added test.
parent 3e5b6045ccfc
No related branches found
No related tags found
No related merge requests found
......@@ -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 ''
......
......@@ -168,6 +168,9 @@
? 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 ..
......@@ -171,8 +174,6 @@
$ cd ..
$ hg init b
$ cd b
$ ln -s nothing dangling
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment