~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-08-19 16:23:39 UTC
  • mto: This revision was merged to the branch mainline in revision 4629.
  • Revision ID: john@arbash-meinel.com-20090819162339-dcw7h5nsyjl9okfa
The api for topo_sort() was to allow a list of (key, value)
or a dict. So we need to cast things back into a dict for KnownGraph.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    # groupcompress ordering is approximately reverse topological,
63
63
    # properly grouped by file-id.
64
64
    per_prefix_map = {}
65
 
    for item in parent_map.iteritems():
66
 
        key = item[0]
 
65
    for key, value in parent_map.iteritems():
67
66
        if isinstance(key, str) or len(key) == 1:
68
67
            prefix = ''
69
68
        else:
70
69
            prefix = key[0]
71
70
        try:
72
 
            per_prefix_map[prefix].append(item)
 
71
            per_prefix_map[prefix][key] = value
73
72
        except KeyError:
74
 
            per_prefix_map[prefix] = [item]
 
73
            per_prefix_map[prefix] = {key: value}
75
74
 
76
75
    present_keys = []
77
76
    for prefix in sorted(per_prefix_map):