[PATCH 0 of 2] keyword: expand RCS/CVS-like keywords in selected files

Christian Ebert blacktrash at gmx.net
Mon Mar 5 10:50:03 UTC 2007


Hi,

Here comes keyword extension again ;)

To create the least overhead it only affects text files that are
explicitly configured in hgrc.

You can choose/mix 2 "modes":

1) "archivemode" is only triggered by "hg archive".
   It then expands keywords in text files configured like so:
   [keyword]
   **.py = archive         ## expand keywords in all python files
   __init__.py = norachive ## but exclude __init__.py

2) "workingmode" expands keywords on update and commit
   operations in the working directory:
   [keyword]
   **.py =
   __init__.py = ignore

CAVEAT:
import/export in workingmode only work in a consistent
environment, ie. with same keyword setup.
If that's not the case use bundle/unbundle or turn off keyword
expansion and update before import/export.

TODO:
As Alexis once mentioned, it would be really nice to make this
work with hgweb (archive). But as far as my experiments go hgweb
doesn't call reposetup, so I don't see any way to do this without
going into Mercurial code. If I am wrong in those assumptions,
I'd be thankful for any pointers or tips.

c



More information about the Mercurial-devel mailing list