comparison hgsubversion/wrappers.py @ 1582:e15dc9e9cd56

wrappers: lock the repo for the whole pull operation It prevents from an unnecessary loading of 'fncache' on each revision.
author Ivan Lezhankin <ilezhankin@yandex-team.ru>
date Mon, 06 Aug 2018 14:52:33 +0300
parents bb09e8a230d6
children 5d8603f080c5
comparison
equal deleted inserted replaced
1581:363d4c2cb880 1582:e15dc9e9cd56
475 total = stopat_rev - start 475 total = stopat_rev - start
476 else: 476 else:
477 total = svn.HEAD - start 477 total = svn.HEAD - start
478 lastpulled = None 478 lastpulled = None
479 479
480 lock = meta.repo.lock()
480 try: 481 try:
481 # start converting revisions 482 # start converting revisions
482 firstrun = True 483 firstrun = True
483 for r in svn.revisions(start=start, stop=stopat_rev): 484 for r in svn.revisions(start=start, stop=stopat_rev):
484 if (r.revnum in skiprevs or 485 if (r.revnum in skiprevs or
532 533
533 lastpulled = r.revnum 534 lastpulled = r.revnum
534 535
535 except KeyboardInterrupt: 536 except KeyboardInterrupt:
536 ui.traceback() 537 ui.traceback()
538 finally:
539 lock.release()
537 finally: 540 finally:
538 if total is not None: 541 if total is not None:
539 ui.progress('pull', None, total=total) 542 ui.progress('pull', None, total=total)
540 util.swap_out_encoding(old_encoding) 543 util.swap_out_encoding(old_encoding)
541 544