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