doc/obs-implementation.rst
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 20 Mar 2012 11:02:11 +0100
changeset 149 03f314e32058
permissions -rw-r--r--
import some doc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
149
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
.. warning:: This document is still in heavy work in progress
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     3
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
-----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
Various technical details
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
-----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     8
Some stuff that worse to note. some may deserve their own section later.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
storing old changeset
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    11
``````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
The new general delta format allow a very efficient storage of two very similar
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    14
changesets. Storing obsolete childrens using general delta takes no more place
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    15
than storing the obsolete diff. Reverted file will even we reused. The whole
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    16
operation will take much less space the strip backup.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    17
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    18
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    19
Abstraction from history rewriting UI
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    20
```````````````````````````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    21
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    22
How Mercurial handle obsolete marker is independent from who decide to create
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    23
them and what actual operation solve error case. Any of the existing history
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    24
rewriting UI (rebase, mq, histedit) can lay obsolete marker and resolve
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    25
situation created by other. To go further a hook system of obsolete marker
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    26
creation would allow each mechanism to collaborate with other though a standard
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    27
and central mechanism.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    29
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    30
Obsolete marker storage
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    31
```````````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    32
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    33
Obsolete marker will most likely be stored outside standard history. They are
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    34
multiple reasons for that:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    35
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
First, obsolete markers are really perpendicular to standard history there is not
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    38
strong reason to include it here other than convenience.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    39
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    40
Second, storing obsolete marker inside standard history means:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    41
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    42
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    43
* A changeset must be created every time an obsolete relation is added. Very
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    44
  inconvenient for delete operation.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    45
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    46
* Obsolete marker must be forged at the creation of the new changeset. This
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    47
  is very inconvenient for split operation. And in general it become
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    48
  complicated to fix history afterward in particular when working with older
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    49
  client.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    50
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    51
Storing obsolete marker outside history have several pro:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    52
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    53
* It ease Exchange of obsolete marker without unnecessary obsolete changeset content
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    54
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    55
* It allow tuning the actual storage and protocol exchange while maintaining
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    56
  compatibility with older client through the wire (as we do the repository
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    57
  format)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    58
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    59
* ease the exchange of obsolete related information during discovery to exchange
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    60
  obsolete changeset relevant to conflict resolution. Exchanging such
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    61
  information deserve a dedicated protocol.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    62
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    63
Persistent
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    64
```````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    65
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    66
*Extinct* changeset and obsolete marker will most likely be garbage collected as
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    67
some point. However, archive server may decide to keep them forever in order to
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    68
keep a fully auditable history in it's finest conception.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    69
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    70
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    71
-----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    72
Current status
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    73
-----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    74
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    75
An experimental implementatione exists. What have been done so far.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    76
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    77
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    78
* 1-1 obsolete marker stored outside history,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    79
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    80
* compute obsolete-tip
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    81
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    82
* obsolete marker exchange through pushkey,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    83
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    84
* compute obsolete, unstable, extinct and suspended set.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    85
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    86
* hidden extinct changesets for UI.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    87
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    88
* Use secret phase to remove from discovery obsolete and unstable changeset (to
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    89
  be improved soon)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    90
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    91
* alter rebase to use obsolete marker instead of stripping. (XXX break --keep for now)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    92
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    93
* Have an experimental mq-like extension to rewrite history (more on that later)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    94
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    95
* Have an extension to update and mq repository according evolution of standard (more on that later)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    96