[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: normalizing files and old revisions

From: Paul Sander
Subject: Re: normalizing files and old revisions
Date: Wed, 3 Sep 2003 08:39:48 -0700

The rinfo program will parse the RCS files and provide info about each
revision.  If you need something it doesn't give then it's easy enough to
add it.

Once you have mapped out the structure of the RCS files, you should be able
to simply use the co program with appropriate -k options to get what you need
out of the file and build a new one using the rcs (or co) and ci programs.

--- Forwarded mail from address@hidden

Andreas Klauer wrote:
> On Sunday 31 August 2003 20:47, Max Bowsher wrote:
>> Andreas Klauer wrote:
>>> Any hints on how to do this?
>> Write a script that walks an RCS file, and for each revision, generates
>> fulltext from the stored diffs, pipes the fulltext through your filter,
>> diffs it against the previous revision, and writes out the new form.
>> Don't forget to use the "next" properties to handle branches correctly.
>> I.e. - not a trivial task.
> First, thank you for your reply. :-)
> The parsing of the RCS files should be trivial enough, the format does not
> look too complicated to me. Of course, I haven't yet read the
> thoroughly enough, so I could be mistaken.

Yes, the basic parsing shouldn't be too difficult. However, the need to
undiff and rediff, whilst respecting branches, is where the complexity

> However, I seem to have a problem with the diffs, considering keywords,
> especially the $Log$ keyword. All my files contain this keyword, and
> naturally, my own diffs contain the automatic changes to this log in every
> revision. However, the original diffs don't, or only do, if someone
> modified the log directly in the file. I'm pretty sure that my diffs will
> mess up things if they contain log changes.

I don't think there is a problem here. You read each revision's text from
the RCS file, (applying diffs to get it), then filter as desired, and
re-generate the diff against the previous revision. Sure, if your filter
changes log text in the file, it will not correspond accurately to the
actual log messages. But that's a problem for the filter, not the method in

Can you explain the problem you percieve in more detail?

> So, my (hopefully not too stupid) question is:
> How can I create diffs exactly the same way CVS does, without considering
> $Log$ and other keyword's stuff?

Take a look at some RCS files. CVS doesn't actually contract keywords on

--- End of forwarded message from address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]