Fix issue995 (copy --after and symlinks pointing to a directory)

I haven't looked at other places that call os.path.isdir to make
sure they're OK.
This commit is contained in:
Alexis S. L. Carvalho 2008-03-14 10:32:19 -03:00
parent 7a9e64075f
commit 6f8858904c
3 changed files with 13 additions and 1 deletions

View File

@ -470,7 +470,7 @@ def copy(ui, repo, pats, opts, rename=False):
if len(pats) == 1:
raise util.Abort(_('no destination specified'))
dest = pats.pop()
destdirexists = os.path.isdir(dest)
destdirexists = os.path.isdir(dest) and not os.path.islink(dest)
if not destdirexists:
if len(pats) > 1 or util.patkind(pats[0], None)[0]:
raise util.Abort(_('with multiple sources, destination must be an '

View File

@ -38,3 +38,13 @@ echo '% copies'
hg cp -v dangling dangling2
hg st -Cmard
$TESTDIR/readlink.py dangling dangling2
echo '% issue995'
hg up -C
mkdir dir
ln -s dir dirlink
hg ci -qAm 'add dirlink'
mkdir newdir
mv dir newdir/dir
mv dirlink newdir/dirlink
hg mv -A dirlink newdir/dirlink

View File

@ -27,3 +27,5 @@ A dangling2
dangling
dangling -> void
dangling2 -> void
% issue995
0 files updated, 0 files merged, 1 files removed, 0 files unresolved