mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
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:
parent
7a9e64075f
commit
6f8858904c
@ -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 '
|
||||
|
@ -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
|
||||
|
@ -27,3 +27,5 @@ A dangling2
|
||||
dangling
|
||||
dangling -> void
|
||||
dangling2 -> void
|
||||
% issue995
|
||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
||||
|
Loading…
Reference in New Issue
Block a user