"RCS $Revision"
Andrew Bennetts
andrew.bennetts at canonical.com
Mon Nov 22 22:17:40 GMT 2010
Michael Andronov wrote:
> Hello -
>
> I'm wondering if bzr has a feature similar to "RCS $Revision"?
The bzr-keywords plugin provides that: https://launchpad.net/bzr-keywords
> Basically, I'm looking into the possibility to put the the latest rev.
> number within the source file.
> It also provides the possibility to put:
> const char * rev= "$Revision$"; and print that out...
An alternative way to generate that is the 'bzr version-info' command.
For example:
bzr version-info --custom --template='const char * revno="{revno}";\n' > revno.c
See 'bzr help version-info' for more details (and more detailed
examples).
> I'm looking for all info/advice regarding above:
> -- if it exists 'naturally' under bzr;
Keyword expansion in files is a bit unnatural in that bzr versions the
whole tree together, rather than independent individual files. Stamping
a file with the revision it was last changed doesn't imply much about
the state of the rest of the source tree.
> -- if it exists as plugging;
Yep, bzr-keywords.
> -- if there are particular reason why not to implement such feature, etc.
If what you want is to automate having the bzr revision details stamped
in your code as part of the build process, you're probably better off
with something like a 'bzr version-info ... > foo.c' step in your build
script.
-Andrew.
More information about the bazaar
mailing list