~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Martin Pool
  • Date: 2005-09-16 03:32:44 UTC
  • mfrom: (1185.1.23)
  • mto: (1185.8.2) (974.1.91)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050916033244-18c4f4bcba663e42
- merge in many integration fixes from Robert

  * xml escaping of unprintable characters

  * 'make clean'

  * new, more consistent Branch constructors 

  * RemoteBranch tests against local farmework

  * scott's non-verbose commit fix 

This seems to break this usage though 

  bzr diff -r 1207..1208 ../bzr.robertc-integration

robertc@robertcollins.net-20050915175953-a16fdc627ce7c541

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
    root, ancestors, descendants = revision_graph(revision_a, revision_source)
236
236
    root_b, ancestors_b, descendants_b = revision_graph(revision_b, 
237
237
                                                        revision_source)
238
 
    assert root == root_b
 
238
    if root != root_b:
 
239
        raise bzrlib.errors.NoCommonRoot(revision_a, revision_b)
239
240
    common = set()
240
241
    for node, node_anc in ancestors_b.iteritems():
241
242
        if node in ancestors:
250
251
    return root, ancestors, descendants, common
251
252
 
252
253
def common_ancestor(revision_a, revision_b, revision_source):
253
 
    root, ancestors, descendants, common = \
254
 
        combined_graph(revision_a, revision_b, revision_source)
 
254
    try:
 
255
        root, ancestors, descendants, common = \
 
256
            combined_graph(revision_a, revision_b, revision_source)
 
257
    except bzrlib.errors.NoCommonRoot:
 
258
        raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
 
259
        
255
260
    nodes = farthest_nodes(descendants, ancestors, root)
256
261
    for node in nodes:
257
262
        if node in common:
258
263
            return node
 
264
    raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
259
265
 
260
266
class MultipleRevisionSources(object):
261
267
    """Proxy that looks in multiple branches for revisions."""