comparison mercurial/commands.py @ 5329:7e6138cb8d38

copy: if destination ends with "/", make sure it's a directory Fixes issue724.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 24 Sep 2007 19:00:11 -0300
parents cba2a689117d
children 4528858e7202
comparison
equal deleted inserted replaced
5318:c6682cdada2f 5329:7e6138cb8d38
621 raise util.Abort(_('no source or destination specified')) 621 raise util.Abort(_('no source or destination specified'))
622 if len(pats) == 1: 622 if len(pats) == 1:
623 raise util.Abort(_('no destination specified')) 623 raise util.Abort(_('no destination specified'))
624 dest = pats.pop() 624 dest = pats.pop()
625 destdirexists = os.path.isdir(dest) 625 destdirexists = os.path.isdir(dest)
626 if (len(pats) > 1 or util.patkind(pats[0], None)[0]) and not destdirexists: 626 if not destdirexists:
627 raise util.Abort(_('with multiple sources, destination must be an ' 627 if len(pats) > 1 or util.patkind(pats[0], None)[0]:
628 'existing directory')) 628 raise util.Abort(_('with multiple sources, destination must be an '
629 'existing directory'))
630 if dest.endswith(os.sep) or os.altsep and dest.endswith(os.altsep):
631 raise util.Abort(_('destination %s is not a directory') % dest)
629 if opts['after']: 632 if opts['after']:
630 tfn = targetpathafterfn 633 tfn = targetpathafterfn
631 else: 634 else:
632 tfn = targetpathfn 635 tfn = targetpathfn
633 copylist = [] 636 copylist = []