comparison mercurial/commands.py @ 15327:67e92d29ecb5 stable

import: abort usefully if no patch name given
author Kevin Bullock <kbullock@ringworld.org>
date Fri, 21 Oct 2011 11:10:43 -0500
parents e174353e8cda
children dbdb777502dc
comparison
equal deleted inserted replaced
15326:8ae2900d6d9b 15327:67e92d29ecb5
3354 _('apply patch to the nodes from which it was generated')), 3354 _('apply patch to the nodes from which it was generated')),
3355 ('', 'import-branch', None, 3355 ('', 'import-branch', None,
3356 _('use any branch information in patch (implied by --exact)'))] + 3356 _('use any branch information in patch (implied by --exact)'))] +
3357 commitopts + commitopts2 + similarityopts, 3357 commitopts + commitopts2 + similarityopts,
3358 _('[OPTION]... PATCH...')) 3358 _('[OPTION]... PATCH...'))
3359 def import_(ui, repo, patch1, *patches, **opts): 3359 def import_(ui, repo, patch1=None, *patches, **opts):
3360 """import an ordered set of patches 3360 """import an ordered set of patches
3361 3361
3362 Import a list of patches and commit them individually (unless 3362 Import a list of patches and commit them individually (unless
3363 --no-commit is specified). 3363 --no-commit is specified).
3364 3364
3416 3416
3417 hg import --exact proposed-fix.patch 3417 hg import --exact proposed-fix.patch
3418 3418
3419 Returns 0 on success. 3419 Returns 0 on success.
3420 """ 3420 """
3421
3422 if not patch1:
3423 raise util.Abort(_('need at least one patch to import'))
3424
3421 patches = (patch1,) + patches 3425 patches = (patch1,) + patches
3422 3426
3423 date = opts.get('date') 3427 date = opts.get('date')
3424 if date: 3428 if date:
3425 opts['date'] = util.parsedate(date) 3429 opts['date'] = util.parsedate(date)