~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Marius Kruger
  • Date: 2008-10-03 23:42:56 UTC
  • mto: This revision was merged to the branch mainline in revision 3809.
  • Revision ID: amanic@gmail.com-20081003234256-jucpuwwgak728l3z
Jump through hoops not to open multiple connections when committing to a bound branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
               config=None,
206
206
               message_callback=None,
207
207
               recursive='down',
208
 
               exclude=None):
 
208
               exclude=None,
 
209
               possible_master_transports=None):
209
210
        """Commit working copy as a new revision.
210
211
 
211
212
        :param message: the commit message (it or message_callback is required)
298
299
                raise ConflictsInTree
299
300
 
300
301
            # Setup the bound branch variables as needed.
301
 
            self._check_bound_branch()
 
302
            self._check_bound_branch(possible_master_transports)
302
303
 
303
304
            # Check that the working tree is up to date
304
305
            old_revno, new_revno = self._check_out_of_date_tree()
444
445
            return
445
446
        raise PointlessCommit()
446
447
 
447
 
    def _check_bound_branch(self):
 
448
    def _check_bound_branch(self, possible_master_transports=None):
448
449
        """Check to see if the local branch is bound.
449
450
 
450
451
        If it is bound, then most of the commit will actually be
455
456
            raise errors.LocalRequiresBoundBranch()
456
457
 
457
458
        if not self.local:
458
 
            self.master_branch = self.branch.get_master_branch()
 
459
            self.master_branch = self.branch.get_master_branch(
 
460
                possible_master_transports)
459
461
 
460
462
        if not self.master_branch:
461
463
            # make this branch the reference branch for out of date checks.