~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/util/_bencode_py.py

  • Committer: Robert Collins
  • Date: 2010-02-27 12:27:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5061.
  • Revision ID: robertc@robertcollins.net-20100227122733-2o3me3fkk3pk36ns
``bzrlib.branchbuilder.BranchBuilder.build_snapshot`` now accepts a
``message_callback`` in the same way that commit does. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        return (r, f + 1)
87
87
 
88
88
    def bdecode(self, x):
 
89
        if type(x) != str:
 
90
            raise TypeError
89
91
        try:
90
92
            r, l = self.decode_func[x[0]](x, 0)
91
93
        except (IndexError, KeyError):
152
154
        encode_int(int(x), r)
153
155
    encode_func[BooleanType] = encode_bool
154
156
 
 
157
from bzrlib._static_tuple_py import StaticTuple
 
158
encode_func[StaticTuple] = encode_list
 
159
try:
 
160
    from bzrlib._static_tuple_c import StaticTuple
 
161
except ImportError:
 
162
    pass
 
163
else:
 
164
    encode_func[StaticTuple] = encode_list
 
165
 
155
166
 
156
167
def bencode(x):
157
168
    r = []