~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-12 05:04:44 UTC
  • mfrom: (5144.1.1 missing-relock)
  • Revision ID: pqm@pqm.ubuntu.com-20100412050444-kmv724lkcq5r23kh
(andrew) Read-lock branches only once in cmd_missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4346
4346
            restrict = 'remote'
4347
4347
 
4348
4348
        local_branch = Branch.open_containing(u".")[0]
 
4349
        local_branch.lock_read()
 
4350
        self.add_cleanup(local_branch.unlock)
 
4351
 
4349
4352
        parent = local_branch.get_parent()
4350
4353
        if other_branch is None:
4351
4354
            other_branch = parent
4360
4363
        remote_branch = Branch.open(other_branch)
4361
4364
        if remote_branch.base == local_branch.base:
4362
4365
            remote_branch = local_branch
 
4366
        else:
 
4367
            remote_branch.lock_read()
 
4368
            self.add_cleanup(remote_branch.unlock)
4363
4369
 
4364
 
        local_branch.lock_read()
4365
 
        self.add_cleanup(local_branch.unlock)
4366
4370
        local_revid_range = _revision_range_to_revid_range(
4367
4371
            _get_revision_range(my_revision, local_branch,
4368
4372
                self.name()))
4369
4373
 
4370
 
        remote_branch.lock_read()
4371
 
        self.add_cleanup(remote_branch.unlock)
4372
4374
        remote_revid_range = _revision_range_to_revid_range(
4373
4375
            _get_revision_range(revision,
4374
4376
                remote_branch, self.name()))