~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-28 01:33:05 UTC
  • mfrom: (2653.2.7 kill-ancestry)
  • Revision ID: pqm@pqm.ubuntu.com-20070728013305-u91kdx3px9ytdyok
Add Graph.is_ancestor, update code to use it

Show diffs side-by-side

added added

removed removed

Lines of Context:
1463
1463
            # we fetch here regardless of whether we need to so that we pickup
1464
1464
            # filled in ghosts.
1465
1465
            self.fetch(other, stop_revision)
1466
 
            my_ancestry = self.repository.get_ancestry(last_rev,
1467
 
                                                       topo_sorted=False)
1468
 
            if stop_revision in my_ancestry:
1469
 
                # last_revision is a descendant of stop_revision
 
1466
            if self.repository.get_graph().is_ancestor(stop_revision,
 
1467
                                                       last_rev):
1470
1468
                return
1471
1469
            self.generate_revision_history(stop_revision, last_rev=last_rev,
1472
1470
                other_branch=other)
1821
1819
        """
1822
1820
        master = self.get_master_branch()
1823
1821
        if master is not None:
1824
 
            old_tip = self.last_revision()
 
1822
            old_tip = _mod_revision.ensure_null(self.last_revision())
1825
1823
            self.pull(master, overwrite=True)
1826
 
            if old_tip in self.repository.get_ancestry(
1827
 
                _mod_revision.ensure_null(self.last_revision()),
1828
 
                topo_sorted=False):
 
1824
            if self.repository.get_graph().is_ancestor(old_tip,
 
1825
                _mod_revision.ensure_null(self.last_revision())):
1829
1826
                return None
1830
1827
            return old_tip
1831
1828
        return None