~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: John Arbash Meinel
  • Date: 2007-04-09 20:35:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2566.
  • Revision ID: john@arbash-meinel.com-20070409203546-7935oty2xm5mj4j8
Add url to bazaar project page in docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
            patch = ''.join(patch_lines)
109
109
            try:
110
110
                bundle_serializer.read_bundle(StringIO(patch))
111
 
            except (errors.NotABundle, errors.BundleNotSupported,
112
 
                    errors.BadBundle):
 
111
            except errors.NotABundle:
113
112
                patch_type = 'diff'
114
113
            else:
115
114
                patch_type = 'bundle'
203
202
        If the message is not supplied, the message from revision_id will be
204
203
        used for the commit.
205
204
        """
206
 
        t_revision_id = revision_id
207
 
        if revision_id == 'null:':
208
 
            t_revision_id = None
209
 
        t = testament.StrictTestament3.from_revision(repository, t_revision_id)
 
205
        t = testament.StrictTestament3.from_revision(repository, revision_id)
210
206
        submit_branch = _mod_branch.Branch.open(target_branch)
211
207
        if submit_branch.get_public_branch() is not None:
212
208
            target_branch = submit_branch.get_public_branch()
214
210
            patch = None
215
211
        else:
216
212
            submit_revision_id = submit_branch.last_revision()
217
 
            submit_revision_id = _mod_revision.ensure_null(submit_revision_id)
218
213
            repository.fetch(submit_branch.repository, submit_revision_id)
219
 
            graph = repository.get_graph()
220
 
            ancestor_id = graph.find_unique_lca(revision_id,
221
 
                                                submit_revision_id)
 
214
            ancestor_id = _mod_revision.common_ancestor(revision_id,
 
215
                                                        submit_revision_id,
 
216
                                                        repository)
222
217
            type_handler = {'bundle': klass._generate_bundle,
223
218
                            'diff': klass._generate_diff,
224
219
                            None: lambda x, y, z: None }