[p4] Integrate & RCS Keywords

Robert Cowham robert at vaccaperna.co.uk
Fri Dec 22 01:12:34 PST 2006


I have a blog article around some aspects of this:

http://www.robertcowham.com/blog/scm/p4_handling_keywords.html

CVS Imports

If you use the cvs2p4 scripts to import a CVS repository you can end up with
a slight problem since the conversion copies the CVS archive files (in RCS
format) and Perforce uses them unchanged. The problem comes about because
CVS stores the keywords already expanded in the RCS archive. Perforce stores
its RCS files with the keywords not expanded, which makes it easier for it
to do the merging between branches (without keyword conflicts). While
Perforce can handle a CVS archive with the the keywords "pre-expanded", it
does lead to spurious merge conflicts. Note that this problem is only really
present during the early merges after the CVS import. It will no longer be
present as soon as the base file for any merge is fully in Perforce format
(i.e. after at least one merge has been done). 


> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> David Weintraub
> Sent: 21 December 2006 15:15
> To: Kris Kumler
> Cc: perforce-user at perforce.com
> Subject: Re: [p4] Integrate & RCS Keywords
> 
> Perforce normally stores files in its depot with unexpanded keywords.
> That way, you don't have this particular issue. Your best 
> choice is to go ahead and fix the RCS keywords on these files 
> during the integration in order to eliminate this headache 
> once and for all.
> 
> The other way is to write your own script to compare the two 
> files sans RCS keywords and revert the ones which match (or 
> even better, mark them as "resolved"). You can use sed with 
> this regex:
> 
>     sed s'/\(\$[A-Za-z][A-Za-z]*:\)[^$]*\$/\1/g'
> 
> and that will unexpand all the RCS keywords, so you can 
> simply compare the two files. However, this won't work for 
> the evil "$Log$" keyword.
> 
> On 12/20/06, Kris Kumler <kris+perforce-user at kumler.us> wrote:
> > I am attempting to do a reverse integration including files 
> with RCS keywords.
> > Many of the files scheduled only include differences with RCS 
> > keywords. e.g. $Id$ on one side and $Id: //depot/file...$ on the 
> > destination side.
> >
> > Is there a setting that can affect this and not schedule 
> this files in 
> > the first place or a command (or script) that will allow me 
> to revert 
> > those files without any changes.
> > Going from an earlier time that this was done here, submitting this 
> > now and then on the next (forward) integration, we'll have to 
> > integrate all of these files again, without any real changes.
> >
> > Is there a compelling reason to accept the integrations as is?
> >
> > Thanks,
> > Kris
> > _______________________________________________
> > perforce-user mailing list  -  perforce-user at perforce.com 
> > http://maillist.perforce.com/mailman/listinfo/perforce-user


More information about the perforce-user mailing list