This lets the repository keep accurate information about all previous
versions.
Repository file state
The repository maintains a per-file record of each revision that been made. We can
model the change list as a sequence of revisions. The database of changes is a map
associating file names to change lists.
partial static class Repository
{
static Map
> db =
Map>.EmptyMap;
}
The first element of a change log is the most recent revision.
Systems with Complex State 173
Client state
Clients of the revision control system have several elements of state. Since these
occur on a per-client basis, we can use maps whose keys are client names.
partial static class User
{
static Map version
= Map.EmptyMap;
static Map> revisions
= Map>.EmptyMap;
static Map> conflicts
= Map>.EmptyMap;
static Set commitPending = Set.EmptySet;
}
The version state variable records the version of the global repository that corresponds
with the most recent commit operation. This is a per-client element of state
because clients may synchronize with the global repository at different times. The
ability of clients to take a snapshot of the repository??™s state is an important feature
of the revision conrol system.
Pages:
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243