comparison mercurial/commands.py @ 18656:8eb3408bf005

import: don't rollback on failed import --exact (issue3616) The checkexact() helper function was calling repo.rollback() from inside an open transaction. In addition to being insane, this is unnecessary because import will release the transaction on an exception. It turns out that this has been broken since the feature was first introduced, first released in v1.0: changeset: 4263:47ba52121433 user: Brendan Cully <brendan@kublai.com> date: Thu Mar 22 10:44:59 2007 -0700 files: mercurial/commands.py mercurial/patch.py description: Add import --exact. When this option is set, import will apply the patch (which must be generated by export) to the parents specified in the patch, and check that the node produced by the patch matches the node ID in the patch.
author Kevin Bullock <kbullock@ringworld.org>
date Sun, 10 Feb 2013 23:01:12 +0000
parents 0027a5cec9d0
children 5e63a85299ba
comparison
equal deleted inserted replaced
18655:882681bc3166 18656:8eb3408bf005
3810 wlock = lock = tr = None 3810 wlock = lock = tr = None
3811 msgs = [] 3811 msgs = []
3812 3812
3813 def checkexact(repo, n, nodeid): 3813 def checkexact(repo, n, nodeid):
3814 if opts.get('exact') and hex(n) != nodeid: 3814 if opts.get('exact') and hex(n) != nodeid:
3815 repo.rollback()
3816 raise util.Abort(_('patch is damaged or loses information')) 3815 raise util.Abort(_('patch is damaged or loses information'))
3817 3816
3818 def tryone(ui, hunk, parents): 3817 def tryone(ui, hunk, parents):
3819 tmpname, message, user, date, branch, nodeid, p1, p2 = \ 3818 tmpname, message, user, date, branch, nodeid, p1, p2 = \
3820 patch.extract(ui, hunk) 3819 patch.extract(ui, hunk)