~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Vincent Ladeuil
  • Date: 2007-06-20 14:25:06 UTC
  • mfrom: (2540 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070620142506-txsb1v8538kpsafw
merge bzr.dev @ 2540

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:
 
111
            except (errors.NotABundle, errors.BundleNotSupported,
 
112
                    errors.BadBundle):
112
113
                patch_type = 'diff'
113
114
            else:
114
115
                patch_type = 'bundle'
202
203
        If the message is not supplied, the message from revision_id will be
203
204
        used for the commit.
204
205
        """
205
 
        t = testament.StrictTestament3.from_revision(repository, revision_id)
 
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)
206
210
        submit_branch = _mod_branch.Branch.open(target_branch)
207
211
        if submit_branch.get_public_branch() is not None:
208
212
            target_branch = submit_branch.get_public_branch()
210
214
            patch = None
211
215
        else:
212
216
            submit_revision_id = submit_branch.last_revision()
 
217
            submit_revision_id = _mod_revision.ensure_null(submit_revision_id)
213
218
            repository.fetch(submit_branch.repository, submit_revision_id)
214
 
            ancestor_id = _mod_revision.common_ancestor(revision_id,
215
 
                                                        submit_revision_id,
216
 
                                                        repository)
 
219
            graph = repository.get_graph()
 
220
            ancestor_id = graph.find_unique_lca(revision_id,
 
221
                                                submit_revision_id)
217
222
            type_handler = {'bundle': klass._generate_bundle,
218
223
                            'diff': klass._generate_diff,
219
224
                            None: lambda x, y, z: None }