comparison mercurial/cmdutil.py @ 6258:c24f4b3f156b

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.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 14 Mar 2008 10:32:19 -0300
parents f89fd07fc51d
children dfdef3d560a8
comparison
equal deleted inserted replaced
6257:bfd49ce0db64 6258:c24f4b3f156b
468 if not pats: 468 if not pats:
469 raise util.Abort(_('no source or destination specified')) 469 raise util.Abort(_('no source or destination specified'))
470 if len(pats) == 1: 470 if len(pats) == 1:
471 raise util.Abort(_('no destination specified')) 471 raise util.Abort(_('no destination specified'))
472 dest = pats.pop() 472 dest = pats.pop()
473 destdirexists = os.path.isdir(dest) 473 destdirexists = os.path.isdir(dest) and not os.path.islink(dest)
474 if not destdirexists: 474 if not destdirexists:
475 if len(pats) > 1 or util.patkind(pats[0], None)[0]: 475 if len(pats) > 1 or util.patkind(pats[0], None)[0]:
476 raise util.Abort(_('with multiple sources, destination must be an ' 476 raise util.Abort(_('with multiple sources, destination must be an '
477 'existing directory')) 477 'existing directory'))
478 if util.endswithsep(dest): 478 if util.endswithsep(dest):