# HG changeset patch # User Joel Rosdahl # Date 2008-01-25 12:48:35 # Node ID 00dfc810dae4bc83463993695bc541f212e8fad7 # Parent 28a79c259fcfd52ac6a80696bff612a2dd0be829 Add --no-commit option to import command diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1528,12 +1528,13 @@ def import_(ui, repo, patch1, *patches, files=files) finally: files = patch.updatedir(ui, repo, files) - n = repo.commit(files, message, user, date) - if opts.get('exact'): - if hex(n) != nodeid: - repo.rollback() - raise util.Abort(_('patch is damaged' - ' or loses information')) + if not opts.get('no_commit'): + n = repo.commit(files, message, user, date) + if opts.get('exact'): + if hex(n) != nodeid: + repo.rollback() + raise util.Abort(_('patch is damaged' + ' or loses information')) finally: os.unlink(tmpname) finally: @@ -2896,6 +2897,7 @@ table = { ('b', 'base', '', _('base path')), ('f', 'force', None, _('skip check for outstanding uncommitted changes')), + ('', 'no-commit', None, _("don't commit, just update the working directory")), ('', 'exact', None, _('apply patch to the nodes from which it was generated')), ('', 'import-branch', None,