~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2005-08-30 06:49:25 UTC
  • Revision ID: mbp@sourcefrog.net-20050830064925-cca3ebda17921f41
- update find-merge-base to use new common_ancestor code

Show diffs side-by-side

added added

removed removed

Lines of Context:
1116
1116
    hidden = True
1117
1117
    
1118
1118
    def run(self, branch, other):
 
1119
        from bzrlib.revision import common_ancestor, MultipleRevisionSources
 
1120
        
1119
1121
        branch1 = find_branch(branch)
1120
1122
        branch2 = find_branch(other)
1121
1123
 
1122
 
        base_revno, base_revid = branch1.common_ancestor(branch2)
 
1124
        history_1 = branch1.revision_history()
 
1125
        history_2 = branch2.revision_history()
 
1126
 
 
1127
        last1 = branch1.last_patch()
 
1128
        last2 = branch2.last_patch()
 
1129
 
 
1130
        source = MultipleRevisionSources(branch1, branch2)
 
1131
        
 
1132
        base_rev_id = common_ancestor(last1, last2, source)
 
1133
 
 
1134
        print 'merge base is revision %s' % base_rev_id
 
1135
        
 
1136
        return
1123
1137
 
1124
1138
        if base_revno is None:
1125
1139
            raise bzrlib.errors.UnrelatedBranches()
1126
1140
 
1127
 
        print 'merge base is revision %s' % base_revid
1128
1141
        print ' r%-6d in %s' % (base_revno, branch)
1129
1142
 
1130
1143
        other_revno = branch2.revision_id_to_revno(base_revid)