VersionMap2Doc.tioga
Mike Spreitzer:PARC:Xerox, March 30, 1992 1:32 pm PST
VersionMap2
PCEDAR 2.0 % FOR INTERNAL XEROX USE ONLY
VersionMap2
A more rational VersionMap interface
Mike Spreitzer
Ó Copyright 1990 Xerox Corporation. All rights reserved.
Abstract: VersionMap2 is an attempt at improving the VersionMap interfaces. The VersionMap2 interfaces are both cleaner, and abstract (different instances can use different implementations, none of which are exposed to the client). This package also implements a command for browsing the version maps.
Created by: Mike Spreitzer:PARC:Xerox
Maintained by: Mike Spreitzer <Mike Spreitzer:PARC:Xerox>
Keywords: Version Map
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Basic Concepts
See VersionMap2.mesa. A VersionMap is a set of VersionTuples. A VersionTuple has a full file name (a PFS.PATH), a create date (a PFS.UniqueID), and a VersionStamp (a MobDefs.VersionStamp).
The VersionMap2Pretty interface is concerned with formatting and parsing VersionMaps and their components.
The VersionMap2Implr interface contains things helpful to those clients that implement VersionMaps.
The VersionMap2Binding interface is concerned with keeping VersionMaps by simple names (like the old VersionMapDefaults). Each simple name should be structured as the concatenation of some <root> and some <kind>, where <kind> is one of "Source", "Intermediate", and "Executable". For ``the current (P)Cedar release'', <root> is the empty string; other <root>s may be used for other purposes. The map associated with a simple name is a union of several other maps. Those maps come from two groups. The first group is the maps contained in the files that VersionMapDefaults consults for the given simple name. The second group is explicitly maintained by commands. For each <root>, there is a list of file name patterns. Each pattern contributes to the union for <root><kind> a map that contains every <n, c, t> where n of c is enumerated by PFS given the pattern, n is classified as a <kind>, and t is the version stamp of n of c. If t is not yet known, it is read from the file and kept in a cache.
1.1. Basic Details
Case is not significant in file names. Period.
In file name patterns, `**' may be used to mean matching that can cross directory boundaries. In effect, `**' acts like the union of `*', `*!*/*', `*!*/*!*/*', and so on. For example (using the standard formatting), both `**:/Foo.bar!*' and `/**!*/Foo.bar!*' are currently-adequate (on Dec 1, 1990) ways to ask for all file names whose short name is `Foo.bar' (modulo the short name's version part). The first has the quirk that it will only match file names whose last directory component has an empty version part. The second has the quirk that it only matches file names whose view (component 0) is empty. I know of no way to write a pattern with no quirks. The obvious string, `**!*:/Foo.bar!*', is considered invalid by PFS for some reason.
In the standard formatting, `*' is a notation for the pattern that matches every file name.
A create date pattern is either an exact literal, or a pattern that matches every create date; the standard formatting for this pattern is `*'.
A version stamp pattern is either an exact literal, or a pattern that matches every version stamp; the standard formatting for this pattern is `*'. The standard formatting for an exact version stamp is 16 hex digits, representing first stamp[0], then stamp[1], as unsigned 32-bit integers.
2. Commands
VM2LS <fileName or $mapName> <full name pattern> [<created pattern> [<version stamp pattern>]]
Lists tuples matching the given patterns in the given version map. A map may be given either by its short name ($name), in which case VersionMap2Binding is consulted, or by the name of a file containing it. For example:

% VM2LS $Source **:/Rope*.df!*
/PCedar2.0/Top/Rope-PCR.df!16 of August 6, 1990 13:23:31 PDT ver A8871CC300000000
/PCedar2.0/Top/Rope-Source.df!13 of August 6, 1990 13:24:03 PDT ver A8871CE300000000
/PCedar2.0/Top/Rope-Suite.df!7 of June 5, 1990 13:36:51 PDT ver A83562E300000000
/PCedar2.0/Top/Rope-Sun4.df!16 of August 6, 1990 13:24:33 PDT ver A8871D0100000000
/PCedar2.0/Top/Rope-sun4O3.df!9 of August 6, 1990 13:25:08 PDT ver A8871D2400000000

% VM2LS $Source * "August 6, 1990 13:23:31 PDT"
/PCedar2.0/Top/Rope-PCR.df!16 of August 6, 1990 13:23:31 PDT ver A8871CC300000000

% VM2LS $Source * * A8871CC300000000
/PCedar2.0/Top/Rope-PCR.df!16 of August 6, 1990 13:23:31 PDT ver A8871CC300000000
ListShortAndCreatedCollisions <fileName or $mapName>
Lists collisions in the given version map.
WatchPatternVersions <root> <pattern>...
Adds the given patterns to those watched for the map associated with simple names having the given root. For now, the patterns have to be ones that PFS can enumerate. For example:

% WatchPatternVersions "" *!*
this adds a pattern, for the contents of the directory current at the time the command is given, to those watched for ``the current Cedar release'' version maps. This is what a Cirio user might do to make files in her current working directory findable by Cirio knowing only the version stamp.
ListPatternVersionsWatches <root>
Lists the patterns watched for the map associated with simple names having the given root.