~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Vincent Ladeuil
  • Date: 2007-09-18 20:04:21 UTC
  • mto: (2885.1.1 140432)
  • mto: This revision was merged to the branch mainline in revision 2886.
  • Revision ID: v.ladeuil+lp@free.fr-20070918200421-9e5bkyohebe2h0eg
Add tests for commit, reuse master branch transport.

* bzrlib/workingtree.py:
(WorkingTree.pull): Add a possible_transports parameter, forward
it to branch.pull.

* bzrlib/branch.py:
(Branch.pull, BzrBranch.pull, BzrBranch5.pull): Add a
possible_transports parameter.
(BzrBranch5.pull): Make master branch transport added to
possible_transports

* bzrlib/tests/commands/test_commit.py: 
New file testing against multiple connections during commit.

* bzrlib/builtins.py:
(cmd_pull.run): Allows master branch transports to be reused.
(cmd_commit): 'fixes' is a ListOption, its default value should
be [].


* bzrlib/tests/commands/test_pull.py: 
Fix import statements.
(TestPull.test_pull_with_bound_branch): New test.

* bzrlib/tests/commands/__init__.py:
(test_suite): Add test_commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
505
505
            raise errors.NoSuchRevision(self, revno)
506
506
        return history[revno - 1]
507
507
 
508
 
    def pull(self, source, overwrite=False, stop_revision=None):
 
508
    def pull(self, source, overwrite=False, stop_revision=None,
 
509
             possible_transports=None):
509
510
        """Mirror source into this branch.
510
511
 
511
512
        This branch is considered to be 'local', having low latency.
1462
1463
 
1463
1464
    @needs_write_lock
1464
1465
    def pull(self, source, overwrite=False, stop_revision=None,
1465
 
             _hook_master=None, run_hooks=True):
 
1466
             _hook_master=None, run_hooks=True, possible_transports=None):
1466
1467
        """See Branch.pull.
1467
1468
 
1468
1469
        :param _hook_master: Private parameter - set the branch to 
1666
1667
        
1667
1668
    @needs_write_lock
1668
1669
    def pull(self, source, overwrite=False, stop_revision=None,
1669
 
             run_hooks=True):
 
1670
             run_hooks=True, possible_transports=None):
1670
1671
        """Pull from source into self, updating my master if any.
1671
1672
        
1672
1673
        :param run_hooks: Private parameter - if false, this branch
1677
1678
        master_branch = None
1678
1679
        if bound_location and source.base != bound_location:
1679
1680
            # not pulling from master, so we need to update master.
1680
 
            master_branch = self.get_master_branch()
 
1681
            master_branch = self.get_master_branch(possible_transports)
1681
1682
            master_branch.lock_write()
1682
1683
        try:
1683
1684
            if master_branch: