~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Vincent Ladeuil
  • Date: 2007-03-14 16:57:31 UTC
  • mfrom: (2359 +trunk)
  • mto: (2323.7.1 redirection)
  • mto: This revision was merged to the branch mainline in revision 2390.
  • Revision ID: v.ladeuil+lp@free.fr-20070314165731-ro7aeu2k3jedut0k
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
        patch_lines = list(line_iter)
99
99
        if len(patch_lines) == 0:
100
100
            patch = None
 
101
            patch_type = None
101
102
        else:
102
103
            patch = ''.join(patch_lines)
103
 
        try:
104
 
            bundle_serializer.read_bundle(StringIO(patch))
105
 
        except errors.NotABundle:
106
 
            patch_type = 'diff'
107
 
        else:
108
 
            patch_type = 'bundle'
 
104
            try:
 
105
                bundle_serializer.read_bundle(StringIO(patch))
 
106
            except errors.NotABundle:
 
107
                patch_type = 'diff'
 
108
            else:
 
109
                patch_type = 'bundle'
109
110
        time, timezone = timestamp.parse_patch_date(stanza.get('timestamp'))
110
111
        kwargs = {}
111
112
        for key in ('revision_id', 'testament_sha1', 'target_branch',
114
115
                kwargs[key] = stanza.get(key)
115
116
            except KeyError:
116
117
                pass
 
118
        kwargs['revision_id'] = kwargs['revision_id'].encode('utf-8')
117
119
        return MergeDirective(time=time, timezone=timezone,
118
120
                              patch_type=patch_type, patch=patch, **kwargs)
119
121