~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: abentley
  • Date: 2006-04-20 23:47:53 UTC
  • mfrom: (1681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: abentley@lappy-20060420234753-6a6874b76f09f86d
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.graph import node_distances, select_farthest, all_descendants, Graph
24
24
from bzrlib.osutils import contains_whitespace
25
25
from bzrlib.progress import DummyProgress
 
26
from bzrlib.symbol_versioning import *
26
27
 
27
28
NULL_REVISION="null:"
28
29
 
250
251
            for root in graph.roots:
251
252
                descendants[NULL_REVISION][root] = 1
252
253
                ancestors[root].append(NULL_REVISION)
253
 
            if len(graph.roots) == 0:
254
 
                # no reachable roots - not handled yet.
255
 
                raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
 
254
            for ghost in graph.ghosts:
 
255
                # ghosts act as roots for the purpose of finding 
 
256
                # the longest paths from the root: any ghost *might*
 
257
                # be directly attached to the root, so we treat them
 
258
                # as being such.
 
259
                # ghost now descends from NULL
 
260
                descendants[NULL_REVISION][ghost] = 1
 
261
                # that is it has an ancestor of NULL
 
262
                ancestors[ghost] = [NULL_REVISION]
 
263
                # ghost is common if any of ghosts descendants are common:
 
264
                for ghost_descendant in descendants[ghost]:
 
265
                    if ghost_descendant in common:
 
266
                        common.add(ghost)
 
267
                
256
268
            root = NULL_REVISION
257
269
            common.add(NULL_REVISION)
258
270
        except bzrlib.errors.NoCommonRoot:
389
401
            source.unlock()
390
402
 
391
403
 
 
404
@deprecated_method(zero_eight)
392
405
def get_intervening_revisions(ancestor_id, rev_id, rev_source, 
393
406
                              revision_history=None):
394
407
    """Find the longest line of descent from maybe_ancestor to revision.