Keyword expansion; Fire and forget keywords

John Arbash Meinel john at arbash-meinel.com
Mon May 19 16:42:23 BST 2008


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

Ian Clatworthy wrote:
| Markus Mayer wrote:
|
|> It would be great to have some sort of $keyword$ that wouldn't get
|> expanded, but replaced. (Maybe by not marking it with single dollar
|> signs, but with double dollars, so that "$Rev$" gets "$Rev: 15 $" but
|> "$$Rev$$" gets "15") This way one could comment everything with skeleton
|> comments containing this keyword and would know that upon the next
|> commit those keywords get replaced with their correct value - and then
|> never again.
|>
|> What do you think?
|
| Interesting idea. I'm not sure if that belongs in the standard keywords
| plugin or not though. BTW, the keywords plugin is being built over the
| top of a generic capability called "content filters". It will be quite
| easy to provide one that does this. See the sample keywords plugin code
| I posted to see how. You'd need to do something similar but just provide
| a 'read converter' without a 'write converter' say.
|
| Ian C.
|
|

I would point out some relevant bits

1) As Martin mentioned, it is often when a feature lands in "trunk/mainline" or
in a release that matters more than when someone introduced the function in
their own branch. So really you want that keyword expanded at a particular time.
Which actually makes a lot more sense as having a "make expand-keywords" action
which is done before a release/when code lands in your trunk.

2) If you use 'revno', which is a nice simple integer, it is context dependent
on the branch it happens in. Revno 15 on my branch may be number 10.1.5 when
merged into the trunk. 'revision_id' is unique and stable, but not very
meaningful for most people. (Bazaar's default revision id generator gives
somewhat useful ids, in that they are "user-timestamp-random". The
user+timestamp at least gives some amount of context.)

John
=:->

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

iEYEARECAAYFAkgxn98ACgkQJdeBCYSNAANRWwCeI9angmzRHh4mRzEITT5vliQb
O/oAoME95Fi5LjTOzElE5JWqO7zYUcaQ
=A/GG
-----END PGP SIGNATURE-----



More information about the bazaar mailing list