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) |