HOME

TheInfoList



OR:

Interleaved deltas, or SCCS weave is a method used by the
Source Code Control System Source Code Control System (SCCS) is a version control system designed to track changes in source code and other text files during the development of a piece of software. This allows the user to retrieve any of the previous versions of the origina ...
to store all revisions of a file. All lines from all revisions are "woven" together in a single block of data, with interspersed control instructions indicating which lines are included in which revisions of the file. Interleaved deltas are traditionally implemented with line oriented text files in mind, although nothing prevents the method from being applied to binary files as well. Interleaved deltas were first implemented by
Marc Rochkind Marc J. Rochkind invented the Source Code Control System while working at Bell Labs Nokia Bell Labs, originally named Bell Telephone Laboratories (1925–1984), then AT&T Bell Laboratories (1984–1996) and Bell Labs Innovations (1996–2007) ...
in the SCCS in 1975. Its design makes all versions available at the same time, so that it takes the same time to retrieve any revision. It also contains sufficient information to identify the author of each line (blaming) in one block. On the other hand, because all revisions for a file are parsed, every operation grows slower as more revisions are added. The term ''interleaved delta'' was coined later in 1982 by Walter F. Tichy, author of the
Revision Control System Revision Control System (RCS) is an early implementation of a version control system (VCS). It is a set of UNIX commands that allow multiple users to develop and maintain program code or documents. With RCS, users can make their own revisions of ...
, which compares the SCCS weave to his new ''reverse delta'' mechanism in RCS.


Implementation in SCCS

In SCCS, the following weave block ^AI 1 ^AD 2 foo ^AE 2 bar ^AI 2 baz ^AE 2 ^AE 1 represents a file that contains the lines "foo" and "bar" in the first release and the lines "bar" and "baz" in the second revision. The string "^A" denotes a control-A character. The control lines in the interleaved delta block have the following meaning: * ^AI ''serial'' Start a block of lines that was inserted with the named serial number. * ^AD ''serial'' Start a block of lines that was removed with the named serial number. * ^AE ''serial'' Block end for a corresponding ^AI or ^AD statement that uses the same serial number.


Advantages

The time it takes to extract any revision from such an interleaved delta block is proportional to the size of the archive. The size of the archive is the sum of the size of all different lines in all revisions. In order to extract a specific revision, an array of structures needs to be constructed, telling whether a specific block, tagged by a serial number in the interleaved deltas, will be copied to the output or not. The original SCCS implementation needs approx. 100 bytes of storage for each different serial number in the deltas in order to know how to extract a specific revision. A SCCS history file with one million deltas would thus need 100 MBytes of virtual memory to unpack. The size could be reduced by approx. 32 bytes per delta if no annotated file retrieval is needed. The advantages of the weave method are the following: * Uniform retrieval time for all revisions of a file. * The possibility to annotate all lines of a file with revision of last change, author of last change and time of last change at no extra costs. * The possibility to merge in non-overlapping branches at no extra costs.


Software using interleaved deltas

*
Source Code Control System Source Code Control System (SCCS) is a version control system designed to track changes in source code and other text files during the development of a piece of software. This allows the user to retrieve any of the previous versions of the origina ...
*
Sun WorkShop TeamWare Sun WorkShop TeamWare (later Forte TeamWare, then Forte Code Management Software) is a distributed source code revision control system made by Sun Microsystems. It was first announced in November 1992 as SPARCworks/TeamWare and ProWorks/TeamWare an ...
*
BitKeeper BitKeeper is a software tool for distributed revision control of computer source code. Originally developed as proprietary software by BitMover Inc., a privately held company based in Los Gatos, California, it was released as open-source software ...
Bazaar A bazaar () or souk (; also transliterated as souq) is a marketplace consisting of multiple small Market stall, stalls or shops, especially in the Middle East, the Balkans, North Africa and India. However, temporary open markets elsewhere, suc ...
intended to use interleaved deltas in 2006, but it was ditched due to poor performance after it was actually implemented in bzr 0.1. It still provides a weave-style merge algorithm.


See also

*
Delta encoding Delta encoding is a way of storing or transmitting data in the form of '' differences'' (deltas) between sequential data rather than complete files; more generally this is known as data differencing. Delta encoding is sometimes called delta compre ...


References

{{Version control software Version control systems