~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-18 00:22:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070218002224-nfsw9ubivr178ahn
Switch all apis over to utf8 file ids. All tests pass

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.