Feature like RCS's $Revision$ keywords?

Asked by Tom Dickson

RCS had the feature where a source file checked out would automatically update certain keywords like $Revision$ to $Revision: 1.2 $ - this allows you to make certain code always have the revision it was when it was checked out available.

Does BZR offer something like that? Right now the closest I have is a shell script I call that runs "bzr revno > revision.txt" - this isn't perfect because revision numbers can retrograde, and I have to remember to run the script. The timestamp of the revision might be an acceptable replacement, but I'd love it if I could get all the options RCS used to offer (such as author, etc).

The search indicates that it was considered for 1.6 - we're now at 2.0 and I cannot find any documentation on it.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
John A Meinel
Solved:
Last query:
Last reply:
Revision history for this message
John A Meinel (jameinel) said :
#1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Dickson wrote:
> New question #94193 on Bazaar:
> https://answers.launchpad.net/bzr/+question/94193
>
> RCS had the feature where a source file checked out would automatically update certain keywords like $Revision$ to $Revision: 1.2 $ - this allows you to make certain code always have the revision it was when it was checked out available.
>
> Does BZR offer something like that? Right now the closest I have is a shell script I call that runs "bzr revno > revision.txt" - this isn't perfect because revision numbers can retrograde, and I have to remember to run the script. The timestamp of the revision might be an acceptable replacement, but I'd love it if I could get all the options RCS used to offer (such as author, etc).
>
> The search indicates that it was considered for 1.6 - we're now at 2.0 and I cannot find any documentation on it.
>

See:
http://wiki.bazaar.canonical.com/KeywordExpansion
and
https://code.launchpad.net/bzr-keywords

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksn6RUACgkQJdeBCYSNAAPHdwCeIWXTQ/OCkRd4HeG4nJSQBPnf
11cAnieBGWMx8ljHaTIMrXyKuYsTIZDc
=IZ6B
-----END PGP SIGNATURE-----

Revision history for this message
Tom Dickson (8-launchpad-bombcar-com) said :
#2

That's almost perfect - but is there a way to get "revno" for the whole project that the file is in? $Revision-Id$ is close but not exact.

Revision history for this message
Tom Dickson (8-launchpad-bombcar-com) said :
#3

It also doesn't seem to expand on export - I use export to make a tarball from the directory; is there a way to make it expand as it exports?

Revision history for this message
John A Meinel (jameinel) said :
#4

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Dickson wrote:
> Question #94193 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/94193
>
> Tom Dickson posted a new comment:
> That's almost perfect - but is there a way to get "revno" for the whole
> project that the file is in? $Revision-Id$ is close but not exact.
>

Revno is only fixed within a given branch, other branches that merge
that revision will have a different revno for it.

That said, I don't know if the bzr-keyword author would be okay adding
revno if it makes sense in some circumstances.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksqibcACgkQJdeBCYSNAANBNwCfVgsbluup1jwcjYt/NjNSnIAF
3woAoLLXIzrZX+ffrrarirt7FmM4GmBd
=Wj5Y
-----END PGP SIGNATURE-----

Revision history for this message
Best John A Meinel (jameinel) said :
#5

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Dickson wrote:
> Question #94193 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/94193
>
> Status: Answered => Open
>
> Tom Dickson is still having a problem:
> It also doesn't seem to expand on export - I use export to make a
> tarball from the directory; is there a way to make it expand as it
> exports?
>

bzr export --filtered IIRC

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksqidsACgkQJdeBCYSNAAMUzgCgs3gxEKs3SsGX3TTiXFXQ4tMx
ub0AnjgKxdzKAmpJiiYzxUoWRrSqNCnV
=D6wk
-----END PGP SIGNATURE-----

Revision history for this message
Tom Dickson (8-launchpad-bombcar-com) said :
#6

That's the key - bzr help export shows the options I can use.

I know revno switches around, but it's mostly stable and is much cleaner looking than Revision-Id, even if Revision-Id is more technically correct.

Revision history for this message
Tom Dickson (8-launchpad-bombcar-com) said :
#7

Thanks John A Meinel, that solved my question.