/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 bzrlib/branch.py

Fix all tests broken by fixing make_branch_and_tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
528
528
        return history[revno - 1]
529
529
 
530
530
    def pull(self, source, overwrite=False, stop_revision=None,
531
 
             possible_transports=None):
 
531
             possible_transports=None, _override_hook_target=None):
532
532
        """Mirror source into this branch.
533
533
 
534
534
        This branch is considered to be 'local', having low latency.
1557
1557
 
1558
1558
    @needs_write_lock
1559
1559
    def pull(self, source, overwrite=False, stop_revision=None,
1560
 
             _hook_master=None, run_hooks=True, possible_transports=None):
 
1560
             _hook_master=None, run_hooks=True, possible_transports=None,
 
1561
             _override_hook_target=None):
1561
1562
        """See Branch.pull.
1562
1563
 
1563
1564
        :param _hook_master: Private parameter - set the branch to 
1568
1569
        """
1569
1570
        result = PullResult()
1570
1571
        result.source_branch = source
1571
 
        result.target_branch = self
 
1572
        if _override_hook_target is None:
 
1573
            result.target_branch = self
 
1574
        else:
 
1575
            result.target_branch = _override_hook_target
1572
1576
        source.lock_read()
1573
1577
        try:
1574
1578
            # We assume that during 'pull' the local repository is closer than
1581
1585
            result.new_revno, result.new_revid = self.last_revision_info()
1582
1586
            if _hook_master:
1583
1587
                result.master_branch = _hook_master
1584
 
                result.local_branch = self
 
1588
                result.local_branch = result.target_branch
1585
1589
            else:
1586
 
                result.master_branch = self
 
1590
                result.master_branch = result.target_branch
1587
1591
                result.local_branch = None
1588
1592
            if run_hooks:
1589
1593
                for hook in Branch.hooks['post_pull']:
1753
1757
        
1754
1758
    @needs_write_lock
1755
1759
    def pull(self, source, overwrite=False, stop_revision=None,
1756
 
             run_hooks=True, possible_transports=None):
 
1760
             run_hooks=True, possible_transports=None,
 
1761
             _override_hook_target=None):
1757
1762
        """Pull from source into self, updating my master if any.
1758
1763
        
1759
1764
        :param run_hooks: Private parameter - if false, this branch
1773
1778
                    run_hooks=False)
1774
1779
            return super(BzrBranch5, self).pull(source, overwrite,
1775
1780
                stop_revision, _hook_master=master_branch,
1776
 
                run_hooks=run_hooks)
 
1781
                run_hooks=run_hooks,
 
1782
                _override_hook_target=_override_hook_target)
1777
1783
        finally:
1778
1784
            if master_branch:
1779
1785
                master_branch.unlock()