Comment 20 for bug 415508

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 415508] Re: Content filtering breaks commit w/ merge parents

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> I'm still wondering whether this is meant to return the sha1 of the
> canonical or convenient content.

We only deal in canonical sha1s.

The sha1 we store in the dirstate is the canonical form.

>
> The steps seem to be:

...

> The code that does filtering, eg internal_size_sha_file_byname seems to
> return both the size and the hash so it seems like any problem that
> affects one should affect the other.
>
> I think before changing get_path_content_summary we need to be clear
> about what the code that's currently using it expects the behaviour to
> be, whether that's to return the filtered or unfiltered content.
>

So path_content_summary is doing:

st = os.lstat(path)
size = st.st_size

sha1_and_other_info = self._check_the_hashcache(path, st)

In other words, it is ignoring the data stored in the dirstate when
returning the size of the file. I believe we store the size into the
dirstate in such a way that we could return it, rather than looking at
st.st_size. Though I'm not positive. (We do for old revisions, but I
would have thought we wouldn't for the *current* column.)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqSr1sACgkQJdeBCYSNAANdnwCgzsRbuponDlkb3J5LCMn5qrsl
n7sAn18N3wcaZYVdsbhkfS4FmL43nPsz
=HCRK
-----END PGP SIGNATURE-----