changeset 19026:1dc393614e61

import: inline checkexact function We have a sngle call now, no need to make it a function.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Wed, 17 Apr 2013 10:25:14 +0200
parents 3af92401efb3
children 3f5fac4b1cfa
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Apr 17 10:22:28 2013 +0200
+++ b/mercurial/commands.py	Wed Apr 17 10:25:14 2013 +0200
@@ -3603,10 +3603,6 @@
     wlock = lock = tr = None
     msgs = []
 
-    def checkexact(repo, n, nodeid):
-        if opts.get('exact') and hex(n) != nodeid:
-            raise util.Abort(_('patch is damaged or loses information'))
-
     def tryone(ui, hunk, parents):
         tmpname, message, user, date, branch, nodeid, p1, p2 = \
             patch.extract(ui, hunk)
@@ -3701,7 +3697,8 @@
                     n = memctx.commit()
                 finally:
                     store.close()
-            checkexact(repo, n, nodeid)
+            if opts.get('exact') and hex(n) != nodeid:
+                raise util.Abort(_('patch is damaged or loses information'))
             if n:
                 # i18n: refers to a short changeset id
                 msg = _('created %s') % short(n)