~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-05 14:47:26 UTC
  • mfrom: (5752.2.11 2.4-windows-lfstat)
  • Revision ID: pqm@pqm.ubuntu.com-20110405144726-zi3lj2kwvjml4kx5
(jameinel) Add osutils.lstat/fstat so that even on Windows lstat(fname) ==
 fstat(open(fname).fileno()) (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
        # return '%X.%X' % (int(st.st_mtime), st.st_mode)
266
266
 
267
267
 
 
268
def _unpack_stat(packed_stat):
 
269
    """Turn a packed_stat back into the stat fields.
 
270
 
 
271
    This is meant as a debugging tool, should not be used in real code.
 
272
    """
 
273
    (st_size, st_mtime, st_ctime, st_dev, st_ino,
 
274
     st_mode) = struct.unpack('>LLLLLL', binascii.a2b_base64(packed_stat))
 
275
    return dict(st_size=st_size, st_mtime=st_mtime, st_ctime=st_ctime,
 
276
                st_dev=st_dev, st_ino=st_ino, st_mode=st_mode)
 
277
 
 
278
 
268
279
class SHA1Provider(object):
269
280
    """An interface for getting sha1s of a file."""
270
281