[PATCH 2 of 2] keyword: add: SVN-like keywords and config section to select their use

Christian Ebert blacktrash at gmx.net
Fri Feb 5 03:58:33 CST 2010


* Kevin Grover on Thursday, February 04, 2010 at 17:58:42 -0600
> On Thu, Feb 4, 2010 at 1:15 AM, Christian Ebert <blacktrash at gmx.net> wrote:
>> * Kevin Grover on Wednesday, February 03, 2010 at 17:08:46 -0600
>>> On Wed, Feb 3, 2010 at 3:40 AM, Christian Ebert <blacktrash at gmx.net>
>> wrote:
>>>> I'm fine with the filters, but I must admit that personally I'm
>>>> not keen on adding more config sections and more -- albeit
>>>> optional -- templates, as I wasn't a friend of default templates
>>>> in the first place.
>>>> 
>>>> The same can be done in a (global) hgrc file already.
>>> 
>>> I agree.  However, it must be done for each repository, each time.
>> 
>> No. As long as you don't have to fear inadvertent expansions,
>> e.g. /etc/mercurial/hgrc or ~/.hgrc works fine system-wide or at
>> $HOME.
>> 
>>> Granted, the keywords still have to be turned on (and the style set to
>> SVN
>>> for subversion keywords), however, if they're in keyword.py, they will be
>>> consistent across all repositories.
>> 
>> Same with a system-wide hgrc.
> 
> Granted.  However, only one set of keywords (those for CVS or those for SVN)
> are active by default.  It would make it much easier for someone to convert
> from SVN to Hg (and use keywords very close to how they were using them in
> svn).  If someone wants custom keywords, they're still welcome to do
> whatever they want.

Sure. I only expressed my (personal) attitude to your proposal
and tried to explain it. My pov is, contrary to yours, to make it
sort of hard (if you think editing hgrc is hard) to set
keywordmaps, because setting them imho should be a conscious act.
The reasons for this being:

1) the extension goes against the nature of a dvcs
2) the extension should be as unobtrusive as possible
3) the less keywordmaps there are
   a) the less the danger of inadverted expansion
   b) the less the speed loss when running it

   (last 2 the reason why setting [keywordmaps] manually
   automatically disableds the default [keywordmaps])

As a side note: I think {rev} is completely useless in a
keywordmap. The keyword support will never be the same as for cvs
or svn. E.g. you can't do cvs' incremental $Log$ either. OTOH the
extension tries to make the most of it by being more flexible
than cvs or svn: it is more configurable -- by editing hgrc ;-).

> By default, if they don't explicitly asked for svn keywords, nothing changes
> from the way things are now (except for the use of os.sep in file names.)

I don't know whether the tests can be run on windows at all, but
if they are, test-keyword (or the filtering of its output) has to
be adapted for windows as well.

c
-- 
\black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
                     Ein deutscher Western/A German Western

         --->> http://www.blacktrash.org/underdogma/ccc.php


More information about the Mercurial-devel mailing list