##// END OF EJS Templates
import: use dirstateguard instead of dirstate.invalidate...
FUJIWARA Katsunori -
r24994:713b09fc default
parent child Browse files
Show More
@@ -4213,7 +4213,7 b' def import_(ui, repo, patch1=None, *patc'
4213 cmdutil.bailifchanged(repo)
4213 cmdutil.bailifchanged(repo)
4214
4214
4215 base = opts["base"]
4215 base = opts["base"]
4216 wlock = lock = tr = None
4216 wlock = dsguard = lock = tr = None
4217 msgs = []
4217 msgs = []
4218 ret = 0
4218 ret = 0
4219
4219
@@ -4221,7 +4221,7 b' def import_(ui, repo, patch1=None, *patc'
4221 try:
4221 try:
4222 try:
4222 try:
4223 wlock = repo.wlock()
4223 wlock = repo.wlock()
4224 repo.dirstate.beginparentchange()
4224 dsguard = cmdutil.dirstateguard(repo, 'import')
4225 if not opts.get('no_commit'):
4225 if not opts.get('no_commit'):
4226 lock = repo.lock()
4226 lock = repo.lock()
4227 tr = repo.transaction('import')
4227 tr = repo.transaction('import')
@@ -4262,18 +4262,16 b' def import_(ui, repo, patch1=None, *patc'
4262 tr.close()
4262 tr.close()
4263 if msgs:
4263 if msgs:
4264 repo.savecommitmessage('\n* * *\n'.join(msgs))
4264 repo.savecommitmessage('\n* * *\n'.join(msgs))
4265 repo.dirstate.endparentchange()
4265 dsguard.close()
4266 return ret
4266 return ret
4267 except: # re-raises
4267 finally:
4268 # wlock.release() indirectly calls dirstate.write(): since
4268 # TODO: get rid of this meaningless try/finally enclosing.
4269 # we're crashing, we do not want to change the working dir
4269 # this is kept only to reduce changes in a patch.
4270 # parent after all, so make sure it writes nothing
4270 pass
4271 repo.dirstate.invalidate()
4272 raise
4273 finally:
4271 finally:
4274 if tr:
4272 if tr:
4275 tr.release()
4273 tr.release()
4276 release(lock, wlock)
4274 release(lock, dsguard, wlock)
4277
4275
4278 @command('incoming|in',
4276 @command('incoming|in',
4279 [('f', 'force', None,
4277 [('f', 'force', None,
General Comments 0
You need to be logged in to leave comments. Login now