/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

  • Committer: Aaron Bentley
  • Date: 2007-09-13 01:54:49 UTC
  • mfrom: (2817 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2826.
  • Revision ID: aaron.bentley@utoronto.ca-20070913015449-bjjw2njf3in5roq7
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
            master.break_lock()
118
118
 
119
119
    @staticmethod
120
 
    def open(base, _unsupported=False):
 
120
    def open(base, _unsupported=False, possible_transports=None):
121
121
        """Open the branch rooted at base.
122
122
 
123
123
        For instance, if the branch is at URL/.bzr/branch,
124
124
        Branch.open(URL) -> a Branch instance.
125
125
        """
126
 
        control = bzrdir.BzrDir.open(base, _unsupported)
 
126
        control = bzrdir.BzrDir.open(base, _unsupported,
 
127
                                     possible_transports=possible_transports)
127
128
        return control.open_branch(_unsupported)
128
129
 
129
130
    @staticmethod
320
321
        return self.repository.get_commit_builder(self, parents, config,
321
322
            timestamp, timezone, committer, revprops, revision_id)
322
323
 
323
 
    def get_master_branch(self):
 
324
    def get_master_branch(self, possible_transports=None):
324
325
        """Return the branch we are bound to.
325
326
        
326
327
        :return: Either a Branch, or None
1485
1486
                if stop_revision is None:
1486
1487
                    stop_revision = source.last_revision()
1487
1488
                self.generate_revision_history(stop_revision)
1488
 
            result.tag_conflicts = source.tags.merge_to(self.tags)
 
1489
            result.tag_conflicts = source.tags.merge_to(self.tags, overwrite)
1489
1490
            result.new_revno, result.new_revid = self.last_revision_info()
1490
1491
            if _hook_master:
1491
1492
                result.master_branch = _hook_master
1594
1595
                raise
1595
1596
        if overwrite:
1596
1597
            target.set_revision_history(self.revision_history())
1597
 
        result.tag_conflicts = self.tags.merge_to(target.tags)
 
1598
        result.tag_conflicts = self.tags.merge_to(target.tags, overwrite)
1598
1599
        result.new_revno, result.new_revid = target.last_revision_info()
1599
1600
        return result
1600
1601
 
1648
1649
 
1649
1650
 
1650
1651
class BzrBranch5(BzrBranch):
1651
 
    """A format 5 branch. This supports new features over plan branches.
 
1652
    """A format 5 branch. This supports new features over plain branches.
1652
1653
 
1653
1654
    It has support for a master_branch which is the data for bound branches.
1654
1655
    """
1697
1698
            return None
1698
1699
 
1699
1700
    @needs_read_lock
1700
 
    def get_master_branch(self):
 
1701
    def get_master_branch(self, possible_transports=None):
1701
1702
        """Return the branch we are bound to.
1702
1703
        
1703
1704
        :return: Either a Branch, or None
1711
1712
        if not bound_loc:
1712
1713
            return None
1713
1714
        try:
1714
 
            return Branch.open(bound_loc)
 
1715
            return Branch.open(bound_loc,
 
1716
                               possible_transports=possible_transports)
1715
1717
        except (errors.NotBranchError, errors.ConnectionError), e:
1716
1718
            raise errors.BoundBranchConnectionFailure(
1717
1719
                    self, bound_loc, e)
1779
1781
        return self.set_bound_location(None)
1780
1782
 
1781
1783
    @needs_write_lock
1782
 
    def update(self):
 
1784
    def update(self, possible_transports=None):
1783
1785
        """Synchronise this branch with the master branch if any. 
1784
1786
 
1785
1787
        :return: None or the last_revision that was pivoted out during the
1786
1788
                 update.
1787
1789
        """
1788
 
        master = self.get_master_branch()
 
1790
        master = self.get_master_branch(possible_transports)
1789
1791
        if master is not None:
1790
1792
            old_tip = _mod_revision.ensure_null(self.last_revision())
1791
1793
            self.pull(master, overwrite=True)