# Changeset View

Changeset View

# Standalone View

Standalone View

# tests/test-graft.t

Show First 20 Lines • Show All 921 Lines • ▼ Show 20 Line(s) | Graft to duplicate a commit twice | ||||

|/ | |/ | ||||

o 0 | o 0 | ||||

Graft from behind a move or rename | Graft from behind a move or rename | ||||

================================== | ================================== | ||||

NOTE: This is affected by issue5343, and will need updating when it's fixed | NOTE: This is affected by issue5343, and will need updating when it's fixed | ||||

Possible cases during a regular graft (when ca is between cta and c2): | Consider this topology for a regular graft: | ||||

o c1 | |||||

| | |||||

| o c2 | |||||

| | | |||||

| o ca # stands for "common ancestor" | |||||

|/ | |||||

o cta # stands for "common topological ancestor" | |||||

Note that in issue5343, ca==cta. | |||||

The following table shows the possible cases. Here, "x->y" and, equivalently, | |||||

"y<-x", where x is an ancestor of y, means that some copy happened from x to y. | |||||

name | c1<-cta | cta<->ca | ca->c2 | name | c1<-cta | cta<->ca | ca->c2 | ||||

A.0 | | | | A.0 | | | | ||||

A.1 | X | | | A.1 | X | | | ||||

A.2 | | X | | A.2 | | X | | ||||

A.3 | | | X | A.3 | | | X | ||||

A.4 | X | X | | A.4 | X | X | | ||||

A.5 | X | | X | A.5 | X | | X | ||||

Show All 11 Lines | |||||

appropriate side of the incomplete divergence, and the result is recorded as a | appropriate side of the incomplete divergence, and the result is recorded as a | ||||

divergence. The code doesn't distinguish at all between these two cases, since | divergence. The code doesn't distinguish at all between these two cases, since | ||||

the end result of them is the same: an incomplete divergence joined with an | the end result of them is the same: an incomplete divergence joined with an | ||||

incomplete rename into a divergence. | incomplete rename into a divergence. | ||||

Finally, A.6 records a divergence entirely in the c2 pass. | Finally, A.6 records a divergence entirely in the c2 pass. | ||||

A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all. | A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all. | ||||

A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge. | A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge. | ||||

A.5 has issue5343 as a special case. | |||||

TODO: add test coverage for A.5 | |||||

A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious | A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious | ||||

incomplete divergence, which is in fact complete. This is handled later in | incomplete divergence, which is in fact complete. This is handled later in | ||||

mergecopies. | mergecopies. | ||||

A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b, | A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b, | ||||

a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting, | a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting, | ||||

the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base | the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base | ||||

case, a<-b<-c->a is treated the same as a<-b<-b->a). | case, a<-b<-c->a is treated the same as a<-b<-b->a). | ||||

▲ Show 20 Lines • Show All 1269 Lines • Show Last 20 Lines |