restricting keyword expansion consistently to working dir (was: [PATCH 0 of 3] keyword: bugfix commands where expansion was not filewise)

Christian Ebert blacktrash at gmx.net
Thu Jan 10 03:59:27 CST 2008


* Jesse Glick on Wednesday, January 09, 2008 at 09:35:32 -0500
> By the way, did you consider using encode/decode hooks instead of a 
> separate command to expand keywords? This would be more like what CVS 
> does (for better or for worse). E.g.
> 
> [decode]
> ** = expand:
> [encode]
> ** = unexpand:
> 
> where you would want to automatically skip over binary files (those 
> which contain NUL).
> 
> 'hg cat' and 'hg di' work on the unexpanded versions, which is probably 
> what you want; the keywords would just get expanded in the working copy.
> 
> An irritation is that Hg does not permit encode/decode hooks to be 
> composed, so for Windows usage you would to add 'expandwithcrlf' and 
> 'unexpandwithcrlf' variants.

I thought about this some more, and perhaps -- I have to actually
/try/ these things to see if they work -- I'll get a more
consistent approach by wrapping wread, wwrite, wwritedata in my
repo subclass and grabbing repo.workingctx at reposetup.

In theory this would avoid the filter chain problem, and I could
provide an additional "hg kwcat" command.

I'm gonna experiment with this, and compare.

Thanks for your input.

c
-- 
_B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html>


More information about the Mercurial-devel mailing list