[Top][All Lists]

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

Re: normalizing files and old revisions

From: Max Bowsher
Subject: Re: normalizing files and old revisions
Date: Tue, 2 Sep 2003 18:22:13 +0100

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


reply via email to

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