import: factor out checkexact
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 17 Apr 2013 10:22:28 +0200
changeset 19025 3af92401efb3
parent 19024 ab04e87a5f3b
child 19026 1dc393614e61
import: factor out checkexact The two calls are strictly identical. We can simply move it after the if/else clause.
mercurial/commands.py
--- a/mercurial/commands.py	Wed Apr 17 03:41:08 2013 +0200
+++ b/mercurial/commands.py	Wed Apr 17 10:22:28 2013 +0200
@@ -3678,7 +3678,6 @@
                     n = repo.commit(message, opts.get('user') or user,
                                     opts.get('date') or date, match=m,
                                     editor=editor)
-                    checkexact(repo, n, nodeid)
             else:
                 if opts.get('exact') or opts.get('import_branch'):
                     branch = branch or 'default'
@@ -3700,9 +3699,9 @@
                                               editor=cmdutil.commiteditor)
                     repo.savecommitmessage(memctx.description())
                     n = memctx.commit()
-                    checkexact(repo, n, nodeid)
                 finally:
                     store.close()
+            checkexact(repo, n, nodeid)
             if n:
                 # i18n: refers to a short changeset id
                 msg = _('created %s') % short(n)