~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph_walker.py

  • Committer: Aaron Bentley
  • Date: 2007-05-26 04:27:39 UTC
  • mto: This revision was merged to the branch mainline in revision 2534.
  • Revision ID: aaron.bentley@utoronto.ca-20070526042739-0o2yva7r05fslgqm
Use GraphWalker.unique_ancestor to determine merge base

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2007 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
1
17
from bzrlib import graph
2
18
from bzrlib.revision import NULL_REVISION
3
19
 
 
20
 
4
21
class GraphWalker(object):
5
22
    """Provide incremental access to revision graphs"""
6
23
 
60
77
 
61
78
        Iteration stops when a unique minimal common ancestor is found.
62
79
        The graph origin is necessarily a unique common ancestor
 
80
 
 
81
        Note that None is not an acceptable substitute for NULL_REVISION.
63
82
        """
64
83
        revisions = [left_revision, right_revision]
65
84
        while True: