"RCS $Revision"
John Arbash Meinel
john at arbash-meinel.com
Mon Nov 22 21:54:39 GMT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/22/2010 2:53 PM, Michael Andronov wrote:
> Hello -
>
> I'm wondering if bzr has a feature similar to "RCS $Revision"?
>
> 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...
>
> I'm looking for all info/advice regarding above:
> -- if it exists 'naturally' under bzr;
> -- if it exists as plugging;
> -- if there are particular reason why not to implement such feature, etc.
>
> Thank you for your kind attention to this matter.
>
> Michael.
It is generally recommended to look into "bzr version-info" either with
a template, or one of the default --format=?
This then gets put into a separate version file, which is then queried
at runtime. (version.c, or version.py, etc)
The main reasons are:
1) Mutating content you are versioning is a little bit icky. I believe
the bzr-keywords plugin does provide some amount of $Revision$, but I
don't know exactly what keys it provides.
Note that this is even worse when dealing with a branching+merging flow,
as both sides of a merge will have directly mutated $Revision$ even if
nothing else conflicted.
SVN is a little better in that it strips the field for commit and merge,
but has the problem that what you commit isn't what you checkout. And
has had quite a few bugs wrt commit at rev 10, checout at rev 12, what
should be in that tag? And IIRC, times when 'svn update -r12' does
something different than 'svn co -r12'.
2) $Revision$ in CVS/SVN is specific to the file, and doesn't give you
the overview of the codebase as a whole. a separate file can give you
both degrees of detail (--include-file-revisions).
(It could give you the repo revno for SVN, but generally only the last
time that file was modified, which means it is poor for a version.c file.)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkzq5p8ACgkQJdeBCYSNAAPKJgCgu+Locx+W1VYYFRLzYji8Ockk
f7EAoLK1pwTPgwkUmeOt/J6koiRvDSar
=A0tY
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list