import: inline checkexact function
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 17 Apr 2013 10:25:14 +0200
changeset 19026 1dc393614e61
parent 19025 3af92401efb3
child 19027 3f5fac4b1cfa
import: inline checkexact function We have a sngle call now, no need to make it a function.
mercurial/commands.py
--- 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)