~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

[merge] bzr.dev 2298 (broken)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import os
22
22
import pprint
23
23
 
 
24
from bzrlib import (
 
25
    osutils,
 
26
    )
24
27
import bzrlib.errors
25
28
from bzrlib.errors import (TestamentMismatch, BzrError, 
26
29
                           MalformedHeader, MalformedPatches, NotABundle)
299
302
 
300
303
        def get_rev_id(last_changed, path, kind):
301
304
            if last_changed is not None:
302
 
                changed_revision_id = last_changed.decode('utf-8')
 
305
                changed_revision_id = osutils.safe_revision_id(last_changed)
303
306
            else:
304
307
                changed_revision_id = revision_id
305
308
            bundle_tree.note_last_changed(path, changed_revision_id)
372
375
            if not info[1].startswith('file-id:'):
373
376
                raise BzrError('The file-id should follow the path for an add'
374
377
                        ': %r' % extra)
375
 
            file_id = info[1][8:]
 
378
            # This will be Unicode because of how the stream is read. Turn it
 
379
            # back into a utf8 file_id
 
380
            file_id = osutils.safe_file_id(info[1][8:])
376
381
 
377
382
            bundle_tree.note_id(file_id, path, kind)
378
383
            # this will be overridden in extra_info if executable is specified.