3 C >= D C is descendant of D, partial order
4 D \isin C C contains changes from D, partial order
5 Patch P has two sets P+, P-
6 Ancestors A(C,P) = { Ca \elem P | Ca <= C }
7 Ends E(C,P) = <=-maximal elements of A(C,P)
9 C \haspatch P <=> [ \forall D \elem P+: D \isin C <=> D <= C ]
10 C \nothaspatch P <=> [ \forall D \elem P+: D \notisin C ]
11 and we maintain C \haspatch P v C \nothaspatch P
15 Commit C is annotated with:
18 Either P s.t. C \elem P
19 or _|_ meaning \notexists_{P} C \elem P.
21 { Pi | C \haspatch Pi }
22 ie the set of included patches
24 For every Px, E(C,Px+)
25 Implicitly for C \elem Pc+, E(C,Pc+) = { C }
26 and this is not annotated explicitly.
27 Also implicitly for P(C) = _|_, \forall_{Px} E(C,Px+) = { }
28 and this is also not annotated explicitly.
31 For C \elem P+: B s.t. E(C,P-) = { B }
34 Of these in principle all except P(C) can be recalculated from the
35 commit history, but that would involve a complete history scan and in
36 the case of \haspatch is clearly impractical. At some point we may
37 provide a checker/sanitiser that recalculates E(C,Px+) and B(C) from
46 D \isin C <=> D \isin A v D = C
50 A \haspatch P <=> C \haspatch P
51 For A \notelem Px+: E(C,Px+) = E(A,Px+)
52 A \elem Px+: E(C,Px+) = { C } -- not annotated
60 D \isin C <=> D \notelement Pr+ ^ D \isin L
63 P(R+) = Pr+, P(R-) = Pr-
64 E(L,Pr+) = { R+ } -- nontrivial, may need R+' = merge of E(L,Pr+)
70 If C \elem P+, B(C) = B(L); otherwise B(C) n/a
71 For P = Pr: C \nothaspatch Pr
72 E(C,Pr+) = E(L,Pr+) = { R+ }
73 P != Pr: C \haspatch P <=> L \haspatch P
82 D \isin C <=> [ (D \isin L ^ D \isin R) v D = C : T ]
83 [ D \notisin L ^ D \notisin R ^ D != C : F ]
84 [ otherwise : D \notisin M ]
89 R \elem P+ ^ B(R) = B(L) -- only merge tips with same base
90 v R \elem P- ^ R >= B(L) ^ M = B(L) -- base when merging into tip
93 If L \haspatch P <=/=> R \haspatch P:
94 \forall Ce \elem E(R,P+): Ce <= L -- may need to merge E(R,P+) into L
99 For C \notelem P+: n/a
100 C \elem P+, R \elem P+: B(L) = B(R)
101 C \elem P+, R \notelem P+: R >= B(L)
104 For L \nothaspatch P, R \nothaspatch P: F
105 L \haspatch P, R \haspatch P: T
106 otherwise: M \nothaspatch P
107 E(C,P+) = maximal elements of E(L,P+) \union E(R,P+)
108 = { Cl | \notexist Cr \elem E(R,P+): Cr >= Cl } \union
109 { Cr | \notexist Cl \elem E(L,P+): Cl >= Cr }
111 -- to reintroduce a dep, set P(C)=P(L)=Pl-, P(R)=Pr+, M=B(R)
112 where L \notelem Pr obv.
121 P(L) = Pl+ v P(L) = _|_
126 D \isin B <=> D \isin L v D = B
132 B \haspatch P <=> L \haspatch P
145 D \isin C <=> D \isin B v D = C
151 For P != Pb: B \haspatch P