changeset 5936:00dfc810dae4

Add --no-commit option to import command
author Joel Rosdahl <joel@rosdahl.net>
date Fri, 25 Jan 2008 13:48:35 +0100
parents 28a79c259fcf
children d8878742a924
files mercurial/commands.py
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Jan 23 21:49:44 2008 +0300
+++ b/mercurial/commands.py	Fri Jan 25 13:48:35 2008 +0100
@@ -1528,12 +1528,13 @@
                                        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 @@
           ('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,