[MERGE] make sha1_provider a parameter to DirState()
Martin Pool
mbp at sourcefrog.net
Wed Mar 18 01:38:00 GMT 2009
2009/3/18 Ian Clatworthy <ian.clatworthy at internode.on.net>:
> Martin Pool wrote:
>> Martin Pool has voted tweak.
>> Status is now: Conditionally approved
>> Comment:
>> Could you change it to SHA (in uppercase) which is consistent with other
>> APIs?
>>
>> +class DefaultSha1Provider(Sha1Provider):
>> + """A Sha1Provider that reads directly from the filesystem."""
>> +
>> + def sha1(self, abspath):
>> + """Return the sha1 of a file given it's absolute path."""
>> + return osutils.sha_file_by_name(abspath)
>> +
>> + def stat_and_sha1(self, abspath):
>
> Which bit did you want changed? The class name? The methods? Both?
> I'm pretty sure the functions in osutils use 'sha' - all in lowercase.
The classname, see
mbp at grace% grep SHA **/*py -n
bzrlib/dirstate.py:106: SHA1
bzrlib/errors.py:1429:class SHA1KnitCorrupt(KnitCorrupt):
bzrlib/foreign.py:232: the SHA1.
bzrlib/hashcache.py:47: """Cache for looking up file SHA-1.
bzrlib/hashcache.py:67: Indexed by path, points to a two-tuple
of the SHA-1 of the file.
bzrlib/hashcache.py:202: """Calculate the SHA1 of a file by
reading the full text"""
OK, so there's only actually one class with that name, but I think the
general convention is that we don't squash acronyms into title case.
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list