# HG changeset patch # User Pierre-Yves David # Date 1366186948 -7200 # Node ID 3af92401efb32d713a6ab9f905ef19c6911b8a5e # Parent ab04e87a5f3bcee588b72d615e1aeb42f10d3b99 import: factor out checkexact The two calls are strictly identical. We can simply move it after the if/else clause. diff -r ab04e87a5f3b -r 3af92401efb3 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)