~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Robert Collins
  • Date: 2005-10-20 01:09:24 UTC
  • mto: (147.1.39) (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: robertc@robertcollins.net-20051020010924-9524a948ff2bdbef
test escaping of file ids is working

Show diffs side-by-side

added added

removed removed

Lines of Context:
577
577
    inv_iter = tree.iter_inventory_ids(source=True, both=True)
578
578
    inv_map = {}
579
579
    for arch_id, path in inv_iter:
580
 
        bzr_file_id = arch_id.replace('%', '%25').replace('/', '%2f')
 
580
        bzr_file_id = map_file_id(arch_id)
581
581
        inv_map[path] = bzr_file_id 
582
582
 
583
583
    bzr_inv = []
652
652
    if version == '0':
653
653
        return "%s/%s" % (category, branch)
654
654
    return "%s/%s/%s" % (category, version, branch)
 
655
 
 
656
def map_file_id(file_id):
 
657
    """Convert a baz file id to a bzr one."""
 
658
    return file_id.replace('%', '%25').replace('/', '%2f')