currentRevision
: (Repository.currentRevision + 1));
}
[Action]
static void CommitComplete([Domain("Users")] string user,
[Domain("NextVersion")] int newVersion)
{
Map
userRevisions = revisions[user];
version = version.Override(user, newVersion);
revisions = revisions.Override(user,Map.EmptyMap);
commitPending = commitPending.Remove(user);
Repository.Commit(user, "Check in", userRevisions);
}
}
In later chapters we will show how the model of revision control system can be
used to predict behavior. For now, let??™s just consider one scenario.
If you look at the scenario given above in Section 10.4.1, you may notice that
user bob had other ways to resolve the conflict. We can use the model to enumerate
what the possible outcomes might have been. These are shown in Figure 10.1. The
Systems with Complex State 181
13
18
8
...
9
CommitComplete("alice", 2)
10
Commit("bob")
11
Revert("bob", "file1")
14
MustResolve("bob", Set("file1"))
Edit("bob", "file1", Op("Change"))
12
Commit("bob")
CommitComplete("bob", 2)
Commit("bob")
16
Resolve("bob", "file1") 15
Revert("bob", "file1")
Revert("bob", "file1")
17
Commit("bob")
Commit("bob") Edit("bob", "file1", Op("Change"))
CommitComplete("bob", 3)
Figure 10.1. Revision control system: Resolution.
figure starts with the CommitComplete("alice", 2) action of the scenario and shows
all possible completions for user bob.
Pages:
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250