Subject: Re: sccstorcs?
To: Current NetBSD users <current-users@netbsd.org>
From: Alan Barrett <apb@cequrux.com>
List: current-users
Date: 04/06/2000 13:10:31
On Thu, 6 Apr 2000, Brett Lymn wrote:
> IIRC the difference between RCS and SCCS is that RCS keeps a full copy
> of the most recent version with diffs to go backwards, whereas SCCS
> keeps the orginal file you checked in and applies diffs to get to the
> most recent version.

Many people seem to think that, but it's quite wrong.  SCCS keeps all
versions in parallel using a mechanism like this (except with a more
efficient encoding for the BEGIN/END tags):

    BEGIN(added in 1.1)
      a line that was introduced in revision 1.1
    BEGIN(added in 1.2)
    BEGIN(deleted in 1.3)
      this line was added in revision 1.2 and deleted in 1.3
    END(deleted in 1.3)
      this line was added in revision 1.2
    END(added in 1.2)
    BEGIN(added in 1.4)
      this line was added in revision 1.4
    END(added in 1.4)
    END(added in 1.1)

Any revision can be efficiently extracted using a single pass through
the file.  You can even extract weird things like "what revision 1.4
would have looked like if the changes from 1.1 to 1.2 had never been
made" with equal efficiency: just make a single pass through the file,
using the BEGIN/END tags to keep track of whether or not to print each
line of text.

The best part is that a human can search for BEGIN/END tags bracketing
a line of interest in the SCCS file to see at what revision that line
was added or deleted.  I really miss that ability when dealing with RCS
files.

--apb (Alan Barrett)