VersionMapBuilding.Mesa
Copyright Ó 1990, 1991, 1992 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on August 7, 1990 1:26:35 pm PDT
Willie-s, March 13, 1992 4:55 pm PST
DIRECTORY BasicTime, IO, PFS, Rope, VersionMap;
VersionMapBuilding: CEDAR DEFINITIONS = {
ROPE: TYPE ~ Rope.ROPE;
MapList: TYPE ~ VersionMap.MapList;
MapUnderConstruction: TYPE ~ REF MapUnderConstructionPrivate;
MapUnderConstructionPrivate: TYPE;
StartConstruction: PROC [size: NAT ¬ 0] RETURNS [MapUnderConstruction];
If size#0, it is taken as an estimate of the numer of entries; OK to under-estimate.
AddFile: PROC [muc: MapUnderConstruction, t: ConsTuple];
Add the tuple <t.name, t.created, t.stamp> to the map under construction. t.name is in appropriate syntax. t.from is an English description of where this tuple came from, for use in generating error messages.
ConsTuple: TYPE ~ RECORD [name, from: ROPE, created: BasicTime.GMT, stamp: VersionMap.VersionStamp];
FinishConstruction: PROC [muc: MapUnderConstruction, prefix: ROPE, PerDuplicate: PROC [a, b: ConsTuple]] RETURNS [VersionMap.Map];
Produce a version map, using the given prefix. Version stamp collisions are reported by calling PerDuplicate.
ClassifyDifference: PROC [a, b: ConsTuple] RETURNS [DifferenceClass];
DifferenceClass: TYPE ~ {identical, identicalModExtensionAndCreated, veryDifferent};
LimitedMap: TYPE ~ RECORD [map: VersionMap.Map, limit: NAT];
Only the first limit entries are valid.
LimitedSave: PROC [lm: LimitedMap, name: PFS.PATH, long: BOOL];
FinishLimitedConstruction: PROC [muc: MapUnderConstruction, prefix: ROPE, PerDuplicate: PROC [a, b: ConsTuple], suppressDuplicates: BOOL] RETURNS [LimitedMap];
Produce a version map, using the given prefix. Version stamp collisions are reported by calling PerDuplicate. If suppressDuplicates, then PerDuplicate is never called with identical ConsTuples, and the result may actually be limited; otherwise, limit=map.Length[] .
}.