~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
from bzrlib.branch import Branch
56
56
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
57
57
from bzrlib.conflicts import ConflictList
58
 
from bzrlib.revision import common_ancestor
59
58
from bzrlib.revisionspec import RevisionSpec
60
59
from bzrlib.workingtree import WorkingTree
61
60
""")
2552
2551
    
2553
2552
    @display_command
2554
2553
    def run(self, branch, other):
2555
 
        from bzrlib.revision import MultipleRevisionSources
 
2554
        from bzrlib.revision import ensure_null, MultipleRevisionSources
2556
2555
        
2557
2556
        branch1 = Branch.open_containing(branch)[0]
2558
2557
        branch2 = Branch.open_containing(other)[0]
2559
2558
 
2560
 
        last1 = branch1.last_revision()
2561
 
        last2 = branch2.last_revision()
 
2559
        last1 = ensure_null(branch1.last_revision())
 
2560
        last2 = ensure_null(branch2.last_revision())
2562
2561
 
2563
 
        source = MultipleRevisionSources(branch1.repository, 
2564
 
                                         branch2.repository)
2565
 
        
2566
 
        base_rev_id = common_ancestor(last1, last2, source)
 
2562
        graph = branch1.repository.get_graph(branch2.repository)
 
2563
        base_rev_id = graph.find_unique_lca(last1, last2)
2567
2564
 
2568
2565
        print 'merge base is revision %s' % base_rev_id
2569
2566
 
2807
2804
                                             " merges.  Not cherrypicking or"
2808
2805
                                             " multi-merges.")
2809
2806
            repository = tree.branch.repository
2810
 
            base_revision = common_ancestor(parents[0],
2811
 
                                            parents[1], repository)
 
2807
            graph = repository.get_graph()
 
2808
            base_revision = graph.find_unique_lca(parents[0], parents[1])
2812
2809
            base_tree = repository.revision_tree(base_revision)
2813
2810
            other_tree = repository.revision_tree(parents[1])
2814
2811
            interesting_ids = None
3541
3538
 
3542
3539
    def run(self, submit_branch=None, public_branch=None, patch_type='bundle',
3543
3540
            sign=False, revision=None, mail_to=None, message=None):
 
3541
        from bzrlib.revision import ensure_null, NULL_REVISION
3544
3542
        if patch_type == 'plain':
3545
3543
            patch_type = None
3546
3544
        branch = Branch.open('.')
3571
3569
                revision_id = revision[0].in_history(branch).rev_id
3572
3570
        else:
3573
3571
            revision_id = branch.last_revision()
 
3572
        revision_id = ensure_null(revision_id)
 
3573
        if revision_id == NULL_REVISION:
 
3574
            raise errors.BzrCommandError('No revisions to bundle.')
3574
3575
        directive = merge_directive.MergeDirective.from_objects(
3575
3576
            branch.repository, revision_id, time.time(),
3576
3577
            osutils.local_time_offset(), submit_branch,