Mercurial > hg > mercurial-crew
changeset 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 | 8ae2900d6d9b |
children | 9b4ab5f7ad2a |
files | mercurial/commands.py tests/test-import.t |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3356,7 +3356,7 @@ _('use any branch information in patch (implied by --exact)'))] + commitopts + commitopts2 + similarityopts, _('[OPTION]... PATCH...')) -def import_(ui, repo, patch1, *patches, **opts): +def import_(ui, repo, patch1=None, *patches, **opts): """import an ordered set of patches Import a list of patches and commit them individually (unless @@ -3418,6 +3418,10 @@ Returns 0 on success. """ + + if not patch1: + raise util.Abort(_('need at least one patch to import')) + patches = (patch1,) + patches date = opts.get('date')