Obsolescence Markers exchange

List of case and expected behavior when exchanging obsolesence marker

/!\ This page is intended for developer

1. Current strategy idea

1.1. Current idea

1. You want all markers relevant changeset common between source and destination to be exchanged 2. Marker relevant to a changeset are:

?. What shall we do on partial split push…

1.2. recent idea

One of the big issue it the necessity to know actual changeset graph to perform the "prune marker of direct children on this changeset".

A radical idea is to store parent information of the precursors in all marker. But his mean a significant inflation of the size of marker. Matt Mackall does not like the idea (because of the extra size).

Pierre-Yves David suspect we could make all necessary computation by just storing parent information in prune marker only:

According to above definition we only care marker from a changeset if:

1) the successors is in the pushed set (actualy pushed or already common) 2) the successors is in a precursors of a marker we care about 3) this is prune marker and we care about the parent of the prune

This me we never need parent information elsewhere than one prune marker.

2. Graph Outline

    ○ ← a changeset,
    ◔ ← changeset being pushed
    ● ← changeset that exist remotly before the push.
    ◕ ← changeset that exist remotly but is not selected by the push
    ⊗ ← pruned changeset
    ø ← obsolete changeset with a precursors
    ◌ ← changeset that does not exist locally but are present in marker history
    ✕ ← changeset that does not exist locally but are pruned in marker history
    ⇠ ← obsolescence marker from that point (if not poiting to anything this mean we do not care about what is point to)

3. A. Simple Case

3.1. A.1 pushing a single heads

3.1.1. A.1.1 pushing a single head

    ⇠◔ A
     |
     ●  O

Marker exist from:

Command run:

Expected exchange:

3.1.2. A.1.2 pushing a multiple changeset into a single head

     ◔ B
     |
    ⇠◔ A
     |
     ● O

Marker exist from:

Command run:

Expected exchange:

3.2. A.2 Two heads

    ⇠○ B
  ⇠◔ | A
   |/
   ● O

Marker exist from:

Command run:

Expected exchange:

Expected Exclude:

3.3. A.3 new branch created

  B' ○⇢ø B
     | |
     \Aø⇠◔ A'
      \|/
       ● O

Marker exist from:

Command run:

Expected exchange:

Expected Exclude:

If A and B are remontly known, we should expect:

3.4. A.4 Push in the middle of the obsolescence chain

(Where we show that we should not push the marker without the successors)

  B ◔
    |
  A⇠ø⇠○ A'
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

Expected Exclude:

3.5. A.5 partial reordering

  B ø⇠⇠
    | ⇡
  A ø⇠⇠⇠○ A'
    | ⇡/
    | ○ B'
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

Expected Exclude:

3.6. A.6 between existing changeset

  A ◕⇠● B
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

3.7. A.7 Non targeted common changeset

   ⇠◕ A
    |
    ● O

Marker exist from:

Command run:

Expected exchange:

4. B. Deletion Case

4.1. B.1 Pruned changeset atop the pushed set

    ⊗ B
    |
    ◔ A
    |
    ● O

Marker exist from:

Command run:

Expected exchange:

4.2. B.2 Pruned changeset on head. nothing pushed

    ⊗ A
    |
    ● O

Marker exist from:

Command run:

Expected exchange:

4.3. B.3 Pruned changeset on non-pushed part of the history

  ⊗ C
  |
  ○ B
  | ◔ A
  |/
  ● O

Marker exist from:

Command run:

Expected exchange:

Expected Exclude:

4.4. B.4 Pruned changeset on common part of history

  ⊗ C
  | ● B
  | |
  | ● A
  |/
  ● O

Marker exist from:

Command run:

Expected exchange:

4.5. B.5 Push of a children of changeset which successors is pruned

This case Mirror A.4, with pruned changeset successors.

  B ◔
    |
  A⇠ø⇠⊗ A'
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

Extra Note:

4.6. B.6 Pruned changeset with ancestors not in pushed set

  B ø⇠⊗ B'
    | |
  A ○ |
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

4.7. B.7 Prune on non targeted common changeset

    ⊗ B
    |
    ◕ A
    |
    ● O

Marker exist from:

Command run:

Expected exchange:

5. C. Advance Case

5.1. C.1 Multiple pruned changeset atop each other

  ⊗ B
  |
  ⊗ A
  |
  ● O

Marker exist from:

Command run:

Expected exchange:

5.2. C.2 Pruned changeset on precursors

  B ⊗
    |
  A ø⇠◔ A'
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

5.3. C.3 Pruned changeset on precursors of another pruned one

  B ⊗
    |
  A ø⇠⊗ A'
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

5.4. C.4 multiple successors, one is pruned

Another case were prune are confusing? (A is killed without its successors being pushed)

(could split of divergence, if split see the Z section)

       A
   B ○⇢ø⇠⊗ C
      \|/
       ● O

Marker exist from:

Command run:

Expected exchange:

Expected exclude:

6. D. Partial Information Case

From then we have changeset missing from the repo but still referenced in obsolescence marker. This has an impact on the knowledge we have from the graph topology.

About any of the above Case could be used too, just drop local knownledge of some/all obsolete changeset.

6.1. D.1 Pruned changeset based on a missing precursors of something we miss

  B ⊗
    |
  A ◌⇠◔ A'
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

6.2. D.2 missing prune target (prune in "pushed set")

  A ø⇠✕ A'
    |/
    ● O

Marker exist from:

Command run:

Expected exchange:

6.3. D.2 missing prune target (prune Not in "pushed set")

(this is one of the case were is will be hard to be non-confusing)

  A ø⇠✕ A'
    | |
    | ○ B
    |/
    ● O

Marker exist from:

Command run:

(shall we account for a secret B?

Expected exchange:

6.4. D.4 Unknown changeset in between known one

Mostly a clarification case

    ø⇠◌⇠○
    | |/
    | ◔
    |/
    ● O

Should be treated as A.3 case:

    ø⇠○
    | |
    | ◔
    |/
    ● O

6.5. D.5 Unknown changeset in between known one

7. Z. Crazy case

When I'm note very sure about what we should do

7.1. Z.1 partial push of split

   D'○⇢ø D
     | | A
   B ○⇢ø⇠◔ C
      \|/
       ● O

Marker exist from:

Command run:

Expected exchange:

Expected exclude: