Auto Header in file
Ezra Smith
ezra.smith at bentley.com
Wed Jul 8 14:41:24 CDT 2009
Robert Bauck Hamar <r.b.hamar <at> usit.uio.no> writes:
>
> *Christian Ebert:
> >* Robert Bauck Hamar on Wednesday, July 08, 2009 at 14:11:20 +0200
> >>> I'm really interest to explore an option in Mercurial and I don't know how
to ...
> >>>
> >>> So when a person add a file, commit, and push on the server. We
> >>> 've got the author of the modif' in the log. I'm searching how to
> >>> automate the add of the author of the modif' and the date directly
> >>> in the modified file. Is it possible to do that?
> >>
> >> There are essentially two options:
> >>
> >> 1. Insert this on input.
> >> 2. Insert on archive/checkout
> >>
> >> 1 is not possible with Mercurial[0].
> >
> >With the keyword extension enabled, like in CVS, the keyword(s)
> >are expanded on commit, update etc. in the working directory.
>
> Yes. By "Insert this on input", I meant storing the author name in the
> checked in version. AFAICS, the keywordextension carefully removes this
> information before commiting. Sorry for expressing myself in an unclear
> manner.
I've found that an encoding hook works nicely when there are things you really
do want to burn into the file on its way into the repository. I've taken this
approach for things like copyright dates and file paths. They change rarely, but
we do want them automatically updated.
(I realize that it's not hard to know where a file is, but some of our
developers are used to having a path they can easily copy/paste within their
editor when looking at a bunch of files)
-Ezra
More information about the Mercurial
mailing list