~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

Merge bzr.dev.

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
 
1734
1745
                self._sha_cutoff_time()
1735
1746
            if (stat_value.st_mtime < self._cutoff_time
1736
1747
                and stat_value.st_ctime < self._cutoff_time):
1737
 
                entry[1][0] = ('f', sha1, entry[1][0][2], entry[1][0][3],
1738
 
                    packed_stat)
 
1748
                entry[1][0] = ('f', sha1, stat_value.st_size, entry[1][0][3],
 
1749
                               packed_stat)
1739
1750
                self._dirblock_state = DirState.IN_MEMORY_MODIFIED
1740
1751
 
1741
1752
    def _sha_cutoff_time(self):