~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: John Arbash Meinel
  • Date: 2007-03-02 03:19:49 UTC
  • mto: (2255.11.3 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: john@arbash-meinel.com-20070302031949-02axv3fix1qfkuqq
Revert back to base64.encodestring() It seems codes.encoder() is actually a wrapper around encodestring() not the other way around.

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
"""
192
192
 
193
193
 
 
194
import base64
194
195
import bisect
195
 
import codecs
196
196
import errno
197
197
import os
198
198
from stat import S_IEXEC
2213
2213
    return lo
2214
2214
 
2215
2215
 
2216
 
_base64_encoder = codecs.getencoder('base64')
2217
 
 
2218
 
 
2219
 
def pack_stat(st, _encode=_base64_encoder, _pack=struct.pack):
 
2216
 
 
2217
def pack_stat(st, _encode=base64.encodestring, _pack=struct.pack):
2220
2218
    """Convert stat values into a packed representation."""
2221
2219
    # jam 20060614 it isn't really worth removing more entries if we
2222
2220
    # are going to leave it in packed form.
2227
2225
    # base64.encode always adds a final newline, so strip it off
2228
2226
    return _encode(_pack('>llllll'
2229
2227
        , st.st_size, int(st.st_mtime), int(st.st_ctime)
2230
 
        , st.st_dev, st.st_ino, st.st_mode))[0][:-1]
 
2228
        , st.st_dev, st.st_ino, st.st_mode))[:-1]