[p4] Perforce keyword expansion
Peter.Jaeckel at impress.com
Tue Dec 4 06:48:30 PST 2001
Perhaps another solution in this special case would be to switch
the type from k+text to ko+text this will only substitute $Id$ and
From: Arnt Gulbrandsen [mailto:arnt at gulbrandsen.priv.no]
Sent: Dienstag, 4. Dezember 2001 14:03
To: Schlueter, Michael
Cc: 'perforce-user at perforce.com'
Subject: Re: [p4] Perforce keyword expansion
"Schlueter, Michael" <Schlueter at secunet.de>
> I just found out that the perforce keyword expansion even replaces the
> keywords normal c++ constant strings. It took me quite while to find out
> that somewhere in a parser syntax definition a $date$ was replaced by the
> current date. Is this a bug or feature?
It's a feature, usually used like this:
const char ident = "$Id$";
Many unix machines have a program called 'ident' that will print the
version strings that went into a linked executable.
> Is there a way to avoid this?
Not short of turning off keyword expansion. Perforce doesn't know c++
syntax (or that of any other language, AFAIK).
I have been troubled by it a few times. ISTR I once had a function that
searched for "$Id$" and of course that function's search string got
changed. But it's never been very difficult to work around the problem.
If you're using plain C++, maybe you can use the preprocessor's string
concatenation: "$Da" "te$" is the same as "$Date$".
perforce-user mailing list - perforce-user at perforce.com
More information about the perforce-user