/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-12-07 00:39:14 UTC
  • mfrom: (2164.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20061207003914-bf8654bb0efe51df
(Robert Collins) Knit Indices should decode their revision ids

Show diffs side-by-side

added added

removed removed

Lines of Context:
1062
1062
            self._history.append(version_id)
1063
1063
        else:
1064
1064
            index = self._cache[version_id][5]
1065
 
        self._cache[version_id] = (version_id, 
 
1065
        self._cache[version_id] = (version_id,
1066
1066
                                   options,
1067
1067
                                   pos,
1068
1068
                                   size,
1081
1081
        # so - wc -l of a knit index is != the number of unique names
1082
1082
        # in the knit.
1083
1083
        self._history = []
 
1084
        decode_utf8 = cache_utf8.decode
1084
1085
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
1085
1086
        try:
1086
1087
            count = 0
1114
1115
                        for value in rec[4:-1]:
1115
1116
                            if '.' == value[0]:
1116
1117
                                # uncompressed reference
1117
 
                                parents.append(value[1:])
 
1118
                                parents.append(decode_utf8(value[1:]))
1118
1119
                            else:
1119
1120
                                # this is 15/4000ms faster than isinstance,
1120
1121
                                # (in lsprof)
1123
1124
                                assert value.__class__ is str
1124
1125
                                parents.append(self._history[int(value)])
1125
1126
                        # end self._parse_parents
1126
 
                        # self._cache_version(rec[0], 
 
1127
                        # self._cache_version(decode_utf8(rec[0]),
1127
1128
                        #                     rec[1].split(','),
1128
1129
                        #                     int(rec[2]),
1129
1130
                        #                     int(rec[3]),
1131
1132
                        # --- self._cache_version
1132
1133
                        # only want the _history index to reference the 1st 
1133
1134
                        # index entry for version_id
1134
 
                        version_id = rec[0]
 
1135
                        version_id = decode_utf8(rec[0])
1135
1136
                        if version_id not in self._cache:
1136
1137
                            index = len(self._history)
1137
1138
                            self._history.append(version_id)
1173
1174
        for value in compressed_parents:
1174
1175
            if value[-1] == '.':
1175
1176
                # uncompressed reference
1176
 
                result.append(value[1:])
 
1177
                result.append(cache_utf8.decode_utf8(value[1:]))
1177
1178
            else:
1178
1179
                # this is 15/4000ms faster than isinstance,
1179
1180
                # this function is called thousands of times a