comparison mercurial/commands.py @ 5336:24de027551c1

Merge with crew-stable
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 24 Sep 2007 19:14:18 -0300
parents 599f3a690d8f 4528858e7202
children 8feb33c2d153
comparison
equal deleted inserted replaced
5328:8d00788ca578 5336:24de027551c1
596 raise util.Abort(_('no source or destination specified')) 596 raise util.Abort(_('no source or destination specified'))
597 if len(pats) == 1: 597 if len(pats) == 1:
598 raise util.Abort(_('no destination specified')) 598 raise util.Abort(_('no destination specified'))
599 dest = pats.pop() 599 dest = pats.pop()
600 destdirexists = os.path.isdir(dest) 600 destdirexists = os.path.isdir(dest)
601 if (len(pats) > 1 or util.patkind(pats[0], None)[0]) and not destdirexists: 601 if not destdirexists:
602 raise util.Abort(_('with multiple sources, destination must be an ' 602 if len(pats) > 1 or util.patkind(pats[0], None)[0]:
603 'existing directory')) 603 raise util.Abort(_('with multiple sources, destination must be an '
604 'existing directory'))
605 if dest.endswith(os.sep) or os.altsep and dest.endswith(os.altsep):
606 raise util.Abort(_('destination %s is not a directory') % dest)
604 if opts['after']: 607 if opts['after']:
605 tfn = targetpathafterfn 608 tfn = targetpathafterfn
606 else: 609 else:
607 tfn = targetpathfn 610 tfn = targetpathfn
608 copylist = [] 611 copylist = []
1467 This summary identifies the repository state using one or two parent 1470 This summary identifies the repository state using one or two parent
1468 hash identifiers, followed by a "+" if there are uncommitted changes 1471 hash identifiers, followed by a "+" if there are uncommitted changes
1469 in the working directory, a list of tags for this revision and a branch 1472 in the working directory, a list of tags for this revision and a branch
1470 name for non-default branches. 1473 name for non-default branches.
1471 """ 1474 """
1475
1476 if not repo and not source:
1477 raise util.Abort(_("There is no Mercurial repository here "
1478 "(.hg not found)"))
1472 1479
1473 hexfunc = ui.debugflag and hex or short 1480 hexfunc = ui.debugflag and hex or short
1474 default = not (num or id or branch or tags) 1481 default = not (num or id or branch or tags)
1475 output = [] 1482 output = []
1476 1483
3151 "version": (version_, [], _('hg version')), 3158 "version": (version_, [], _('hg version')),
3152 } 3159 }
3153 3160
3154 norepo = ("clone init version help debugancestor debugcomplete debugdata" 3161 norepo = ("clone init version help debugancestor debugcomplete debugdata"
3155 " debugindex debugindexdot debugdate debuginstall") 3162 " debugindex debugindexdot debugdate debuginstall")
3156 optionalrepo = ("paths serve showconfig") 3163 optionalrepo = ("identify paths serve showconfig")