Mercurial > hg
comparison hgext/rebase.py @ 32917:070920db8b87
rebase: use context manager for locking in rebase()
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 19 Jun 2017 11:18:05 -0700 |
parents | 07d5a503124c |
children | 04c9dd951a41 |
comparison
equal
deleted
inserted
replaced
32916:88c1d13b637b | 32917:070920db8b87 |
---|---|
681 unresolved conflicts. | 681 unresolved conflicts. |
682 | 682 |
683 """ | 683 """ |
684 rbsrt = rebaseruntime(repo, ui, opts) | 684 rbsrt = rebaseruntime(repo, ui, opts) |
685 | 685 |
686 lock = wlock = None | 686 with repo.wlock(), repo.lock(): |
687 try: | |
688 wlock = repo.wlock() | |
689 lock = repo.lock() | |
690 | |
691 # Validate input and define rebasing points | 687 # Validate input and define rebasing points |
692 destf = opts.get('dest', None) | 688 destf = opts.get('dest', None) |
693 srcf = opts.get('source', None) | 689 srcf = opts.get('source', None) |
694 basef = opts.get('base', None) | 690 basef = opts.get('base', None) |
695 revf = opts.get('rev', []) | 691 revf = opts.get('rev', []) |
751 raise | 747 raise |
752 except Exception: | 748 except Exception: |
753 release(dsguard) | 749 release(dsguard) |
754 raise | 750 raise |
755 rbsrt._finishrebase() | 751 rbsrt._finishrebase() |
756 finally: | |
757 release(lock, wlock) | |
758 | 752 |
759 def _definesets(ui, repo, destf=None, srcf=None, basef=None, revf=None, | 753 def _definesets(ui, repo, destf=None, srcf=None, basef=None, revf=None, |
760 destspace=None): | 754 destspace=None): |
761 """use revisions argument to define destination and rebase set | 755 """use revisions argument to define destination and rebase set |
762 """ | 756 """ |