/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: Andrew Bennetts
  • Date: 2007-08-02 06:40:58 UTC
  • mfrom: (2666 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2668.
  • Revision ID: andrew.bennetts@canonical.com-20070802064058-09eblz1qbc01fcr3
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
    def open_downlevel(base):
121
121
        """Open a branch which may be of an old format."""
122
122
        return Branch.open(base, _unsupported=True)
123
 
        
 
123
 
124
124
    @staticmethod
125
125
    def open(base, _unsupported=False):
126
126
        """Open the branch rooted at base.
132
132
        return control.open_branch(_unsupported)
133
133
 
134
134
    @staticmethod
135
 
    def open_containing(url):
 
135
    def open_from_transport(transport, _unsupported=False):
 
136
        """Open the branch rooted at transport"""
 
137
        control = bzrdir.BzrDir.open_from_transport(transport, _unsupported)
 
138
        return control.open_branch(_unsupported)
 
139
 
 
140
    @staticmethod
 
141
    def open_containing(url, possible_transports=None):
136
142
        """Open an existing branch which contains url.
137
143
        
138
144
        This probes for a branch at url, and searches upwards from there.
143
149
        format, UnknownFormatError or UnsupportedFormatError are raised.
144
150
        If there is one, it is returned, along with the unused portion of url.
145
151
        """
146
 
        control, relpath = bzrdir.BzrDir.open_containing(url)
 
152
        control, relpath = bzrdir.BzrDir.open_containing(url,
 
153
                                                         possible_transports)
147
154
        return control.open_branch(), relpath
148
155
 
149
156
    @staticmethod
1456
1463
            # we fetch here regardless of whether we need to so that we pickup
1457
1464
            # filled in ghosts.
1458
1465
            self.fetch(other, stop_revision)
1459
 
            my_ancestry = self.repository.get_ancestry(last_rev,
1460
 
                                                       topo_sorted=False)
1461
 
            if stop_revision in my_ancestry:
1462
 
                # last_revision is a descendant of stop_revision
 
1466
            if self.repository.get_graph().is_ancestor(stop_revision,
 
1467
                                                       last_rev):
1463
1468
                return
1464
1469
            self.generate_revision_history(stop_revision, last_rev=last_rev,
1465
1470
                other_branch=other)
1814
1819
        """
1815
1820
        master = self.get_master_branch()
1816
1821
        if master is not None:
1817
 
            old_tip = self.last_revision()
 
1822
            old_tip = _mod_revision.ensure_null(self.last_revision())
1818
1823
            self.pull(master, overwrite=True)
1819
 
            if old_tip in self.repository.get_ancestry(
1820
 
                _mod_revision.ensure_null(self.last_revision()),
1821
 
                topo_sorted=False):
 
1824
            if self.repository.get_graph().is_ancestor(old_tip,
 
1825
                _mod_revision.ensure_null(self.last_revision())):
1822
1826
                return None
1823
1827
            return old_tip
1824
1828
        return None