comparison mercurial/commands.py @ 16274:5d75eb8568d1

encoding: tune fast-path of tolocal a bit
author Matt Mackall <mpm@selenic.com>
date Thu, 22 Mar 2012 16:54:46 -0500
parents 0d175ac527c1
children a740fa28d718
comparison
equal deleted inserted replaced
16273:12e3f93b1cbc 16274:5d75eb8568d1
3620 os.unlink(tmpname) 3620 os.unlink(tmpname)
3621 3621
3622 try: 3622 try:
3623 try: 3623 try:
3624 wlock = repo.wlock() 3624 wlock = repo.wlock()
3625 lock = repo.lock() 3625 if not opts.get('no_commit'):
3626 tr = repo.transaction('import') 3626 lock = repo.lock()
3627 tr = repo.transaction('import')
3627 parents = repo.parents() 3628 parents = repo.parents()
3628 for patchurl in patches: 3629 for patchurl in patches:
3629 if patchurl == '-': 3630 if patchurl == '-':
3630 ui.status(_('applying patch from stdin\n')) 3631 ui.status(_('applying patch from stdin\n'))
3631 patchfile = ui.fin 3632 patchfile = ui.fin
3647 parents = [repo[node]] 3648 parents = [repo[node]]
3648 3649
3649 if not haspatch: 3650 if not haspatch:
3650 raise util.Abort(_('%s: no diffs found') % patchurl) 3651 raise util.Abort(_('%s: no diffs found') % patchurl)
3651 3652
3652 tr.close() 3653 if tr:
3654 tr.close()
3653 if msgs: 3655 if msgs:
3654 repo.savecommitmessage('\n* * *\n'.join(msgs)) 3656 repo.savecommitmessage('\n* * *\n'.join(msgs))
3655 except: 3657 except:
3656 # wlock.release() indirectly calls dirstate.write(): since 3658 # wlock.release() indirectly calls dirstate.write(): since
3657 # we're crashing, we do not want to change the working dir 3659 # we're crashing, we do not want to change the working dir