pre-commit hooks and $Id$ banners?

Aaron Bentley aaron.bentley at utoronto.ca
Sun Apr 23 17:00:46 BST 2006


John Arbash Meinel wrote:
> 1) Change line 175 in hashcache.py, which reads in the files, and
> computes their sha1 sum. This needs to change so that instead of just
> plain reading a file, we actually filter the file, to unexpand the keywords.
> 
>    Doing it this way means that the working inventory looks like the
> final inventory, but we have to unescape every file we come across. And
> the value in .bzr/stat-cache doesn't match a simple 'sha1sum file/foo'.

As you noted below, we would only need to unexpand ("contract?") files 
that may contain keywords.

> 2) Add a field to the working inventory. So that we have sha1, and we
> have expanded_sha1. Then when doing something like 'bzr status' we
> compare against the expanded sha1. 

This seems like the more straightforward solution to me.  Option 1 would 
mean intertwining expansion and the hashcache, and it feels icky.  The 
hashcache should be simple.

I'd rather call it storage_sha1, because that would allow us to use the 
unexpanded sha_1 in RevisionTree inventories.

Although you've mentioned the problems keywords pose for merge, you 
haven't described how merge would handle keyword files.

It seems pretty obvious that merge should operate on the unexpanded 
text, but probably TreeTransform should be modified to perform expansion 
when writing files out, as it must expand
1. merged texts
2. conflict files (THIS, BASE, OTHER).  Conflict files must be expanded, 
because one resolution of the conflict is to rename foo.OTHER or 
foo.THIS to foo.

Doing it in TreeTransform means you also get expansion
1. When checking out trees
2. When reverting

Aaron




More information about the bazaar mailing list