/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/fetch_ghosts.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from __future__ import absolute_import
18
18
 
19
 
from . import cleanup
20
19
from .branch import Branch
21
20
from .trace import note
22
21
from .errors import NoSuchRevision, BzrCommandError
43
42
 
44
43
    def run(self):
45
44
        lock_other = self.this_branch.base != self.other_branch.base
46
 
        with cleanup.ExitStack() as exit_stack:
47
 
            exit_stack.enter_context(self.this_branch.lock_write())
 
45
        with self.this_branch.lock_write():
48
46
            if lock_other:
49
 
                exit_stack.enter_context(self.other_branch.lock_read())
50
 
            return self._run_locked()
 
47
                self.other_branch.lock_read()
 
48
            try:
 
49
                return self._run_locked()
 
50
            finally:
 
51
                if lock_other:
 
52
                    self.other_branch.unlock()
51
53
 
52
54
    def iter_ghosts(self):
53
55
        """Find all ancestors that aren't stored in this branch."""