keyword: versioning my homedir and ~/.hgrc

Christian Ebert blacktrash at
Sun Jul 5 21:34:40 CDT 2009

* Giorgos Keramidas on Monday, July 06, 2009 at 03:41:06 +0300
> On Mon, 6 Jul 2009 00:26:49 +0200, Christian Ebert <blacktrash at> wrote:
>> .hg* is excluded on purpose:
> I can understand why '.hg/**' shouldn't be allowed to expand, but I am
> not sure I fully agree with <workspace>/.hgrc and <workspace>/.hgignore.

.hgtags, .hg_archival.txt ...

>> As the keyword extension allows the expansion of _arbitrary_ keywords
>> (albeit within $...$) the risk of inadvertent expansion in files that
>> contain configuration regexes is even higher than "normal".
> A mercurial repository can contain all sorts of files that can have
> problems with automagic expansion.  A perl script that lives inside a
> Mercurial repository and includes:
>    #!/usr/bin/perl -Tw
>    my $id = "$Custom: 1.2 keramida $";
>    print "$id\n";
> will fail to execute at all:
>    $ perl -Tw
>    Final $ should be \$ or $name at line 3, within string
>    syntax error at line 3, near "= "$Custom: 1.2 keramida $""
>    Execution of aborted due to compilation errors.
> As a user of the keyword extension I feel responsible for not adding
> keywords to places where they may cause such problems.  I agree that
> allowing keywords in <workspace>/.hgignore is risky, but it is not more
> dangerous than allowing keywords in Perl scripts, in shell scripts, in
> XML documents, in Lisp code, or a *lot* of other files whose syntax
> may be broken by a misplaced keyword.
> Would it be very bad to at least make the '.hg*' exclusion pattern
> optional/tunable and default to yes?

One could argue that the keyword extension by nature is bad
because it changes the state of the working directory, plus it
goes against the grain of a DVCS because it works file-wise and
not repo-wide. I believe Matt cringes every time the keyword
extension is mentioned ;-)

I think the extension makes sense when you discuss/work on a
project with people who don't run a VCS; LaTeX is a good example.
For the outside world, so to speak.

But _within_ Mercurial I don't see the need, really. As I said in
my second argument, all the info is there with a simple
"hg log -l1 file".

To what end do you want to have versioned keywords in .hg* files?
Besides for the purpose of being bad, which I support
wholeheartedly ;-) I don't see that it makes sense.

  Was heißt hier Dogma, ich bin Underdogma!
[ What the hell do you mean dogma, I am underdogma. ]
_F R E E_  _V I D E O S_

More information about the Mercurial-devel mailing list