--- a/mercurial/commands.py Sun Sep 23 14:40:44 2007 +0200
+++ b/mercurial/commands.py Mon Sep 24 19:00:11 2007 -0300
@@ -623,9 +623,12 @@
raise util.Abort(_('no destination specified'))
dest = pats.pop()
destdirexists = os.path.isdir(dest)
- if (len(pats) > 1 or util.patkind(pats[0], None)[0]) and not destdirexists:
- raise util.Abort(_('with multiple sources, destination must be an '
- 'existing directory'))
+ if not destdirexists:
+ if len(pats) > 1 or util.patkind(pats[0], None)[0]:
+ raise util.Abort(_('with multiple sources, destination must be an '
+ 'existing directory'))
+ if dest.endswith(os.sep) or os.altsep and dest.endswith(os.altsep):
+ raise util.Abort(_('destination %s is not a directory') % dest)
if opts['after']:
tfn = targetpathafterfn
else: