docs/obs-concept.rst
author Arne Babenhauserheide <bab@draketo.de>
Tue, 27 Mar 2012 20:03:59 +0200
changeset 183 8907a9269549
parent 176 4da5ecfb5d41
child 184 f047cd4f1235
permissions -rw-r--r--
docs: polish for glossary
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
     1
==============================
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
     2
 Why Do We Need a New Concept
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
     3
==============================
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
     4
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
     5
Current DVCS are great tool to forge a series of flawless changeset on your own.
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
     6
But they perform poorly when is comes to **share** work in progress and
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
     7
**collaborate** on such work in progress.
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
     8
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
     9
When people forge new version of a changeset they create a new changeset and get
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    10
ride of the original changeset. Difficulties to collaborate mostly came from the
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    11
way old content are *removed* from repository.
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    12
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    13
Mercurial Approach: Strip
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    14
=========================
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    15
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    16
With current version of mercurial, every changesets that exist in your
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    17
repository are *visible* and *meaningful*. To get ride of old changeset you
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    18
rewrote mercurial remove them from the repository storage. with an operation
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    19
called *strip*. After the *strip* the repository looks like if the changeset
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    20
never existed.
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    21
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    22
This approach is simple and effective but have a very big drawback: You can
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    23
remove changesets from **your repository only**. If strip exists in other
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    24
repositories it will show of again and again. This only cure for this is to
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    25
strip the offending changeset from all repository. And operation at best
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    26
impractical and in most case impossible!
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    27
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    29
As consequence, **you can not rewrite something once you exchange it with
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    30
others**. The old version will still exists along side the new one [#]_.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    31
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    32
Moreover stripping changesets creates backup bundles. This allows
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    33
restoration of the deleted changesets, but the process is painful.
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    34
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    35
Finally, as the repository format is not optimized for deletion. stripping a
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    36
changeset may be slow in some situations.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    38
To sum up, the strip approach is very simple but does not handle interaction
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    39
with the outer world. Which is unfortunate for a *Distributed* VCS.
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    40
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    41
.. [#] various work around exists but they require their own workflows which are distinct from the very elegant basic workflow of Mercurial.
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    42
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    43
Git Approach: Overwrite Reference
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    44
=================================
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    45
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    46
Git approach for repository is a bit more complex: Any number of
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    47
changesets can exist in a repository. but **only changesets referenced by a git
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    48
branch** are *visible* and *meaningful*.
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    49
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    50
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    51
.. warning:: add a schema::
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    52
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    53
        C
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    54
        | B---<foo>
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    55
        |/
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    56
        |
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    57
        A
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    58
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    59
    Only B and A are visible.
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    60
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    61
This simplifies the process of getting rid of old changesets. You can
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    62
just leave them in place and move the reference on the new one. You
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    63
can then propagate that change by moving the git-branch on remote host
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    64
with the newer version of the marker overwriting the older one.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    65
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    66
This approach goes a bit further but still has a major drawback:
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    67
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    68
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    69
Because you **overwrite** the git-branch, you have no conflict resolution. The last
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    70
to act wins. This makes collaboration on multiple changesets difficult because
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    71
you can't merge concurrent updates on a changeset.
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    72
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    73
Every overwrite is a forced operation where the operator say "Yes I want this to
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    74
replace that. In highly distributed environments, a user may end up with conflicting
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    75
references and no proper way to choose.
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    76
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    77
Because of this way to visualize a repository, git-branches are a core
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    78
part of git, which makes the user interface more complicated and
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    79
constrains the ways to move through history.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    80
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    81
Finally, even if all older changeset still exist in the repository, access to them
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    82
is still painful.
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    83
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    84
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    85
=============================
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    86
 The Obsolete Marker Concept
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    87
=============================
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    88
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    89
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    90
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    91
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    92
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    93
As None of the concepts was powerful enough to fulfill the need of safely rewriting
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    94
history, including easy sharing and collaborating on mutable history, we needed another one.
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
    95
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    96
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
Basic concept
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
    99
=============
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   100
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   101
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   102
Every history rewriting operation stores the information that the old rewritten
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   103
changeset is replaced by newer version in a given set of changeset.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   104
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   105
All basic history rewriting operation can create an appropriate obsolete marker.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   106
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   107
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   108
.. figure:: ./figures/example-1-update.*
161
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
    *Updating* a changeset
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   111
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   112
    Create one obsolete marker: ``([A'] obsolete A)``
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   113
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   114
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   115
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   116
.. figure:: ./figures/example-2-split.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   117
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   118
    *Splitting* a changeset in multiple one
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   119
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   120
    Create one obsolete marker ``([B1, B2] obsolete B)]``
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   121
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   122
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   123
.. figure:: ./figures/example-3-merge.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   124
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   125
    *Merging* multiple changeset in a single one
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   126
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   127
    Create two obsolete markers ``([C] obsolete A), ([C] obsolete B)``
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   128
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   129
.. figure:: ./figures/example-4-reorder.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   130
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   131
    *Moving* changeset around
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   132
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   133
    Reordering those two changesets need two obsolete markers:
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   134
    ``([A'] obsolete A), ([B'] obsolete B)``
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   135
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   136
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   137
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   138
.. figure:: ./figures/example-5-delete.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   139
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   140
    *Removing* a changeset:
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   141
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   142
    One obselete marker ``([] obsolete B)``
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   143
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   144
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   145
To conclude, a single obsolete marker express a relation from **0..n** new
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   146
changesets to **1** old changeset.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   147
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   148
Basic Usage
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   149
===========
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   150
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   151
Obsolete markers create a perpendicular history: **a versioned changeset graph**. This means that offers the same features we have for
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   152
versioned files but applied to changeset:
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   153
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   154
First: we can display a **coherent view** of the history graph in which only a
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   155
single version of your changesets are displayed by the UI.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   156
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   157
Second, because obsolete changeset content is still **available**. You can 
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   158
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   159
    * **browse** the content of your obsolete commit,
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   160
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   161
    * **compare** newer and older version of a changeset,
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   162
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   163
    * **restore** content of previously obsolete changeset.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   164
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   165
Finally, obsolete marker can be **exchanged between repositories**. You are able to
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   166
share the result on your history rewriting operation with other and **collaborate
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   167
on mutable part of the history**.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   168
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   169
Conflicting history rewriting operation can be detected and **resolved** as easily
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   170
as conflicting changes on file.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   171
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   172
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   173
Detecting and solving tricky situations
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   174
======================================
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   175
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   176
History rewriting can lead to complex situations. Obsolete marker introduce a
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   177
simple representation of this complex reality. But people using complex workflows
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   178
will one day or another have to face the intrinsic complexity of some
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   179
situations.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   180
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   181
This section describes possible situations, defines precise sets of changesets
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   182
involved in such situations and explains how error cases can automatically be
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   183
resolved using available information.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   184
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   185
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   186
obsolete changesets
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   187
-------------------
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   188
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   189
Old changesets left behind by obsolete operation are called **obsolete**.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   190
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   191
With the current version of mercurial, this *obsolete* part is stripped from the
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   192
repository before the end of every rewriting operation.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   193
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   194
.. figure:: ./figures/error-obsolete.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   195
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   196
    Rebasing `B` and `C` on `A` (as `B'`, `C'`)
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   197
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   198
    This rebase operation added two obsolete markers from new changesets to old
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   199
    changesets. These two old changesets are now part of the *obsolete* part of the
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   200
    history.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   201
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   202
In most cases, the obsolete set will be fully hidden to both UI and discovery so
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   203
the user does not have to care about them unless he wants to audit the history rewriting
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   204
operation.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   205
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   206
Unstable changesets
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   207
-------------------
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   208
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   209
While exploring the possibilities of the obsolete a bit further, you may end up with
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   210
*obsolete* changeset which have *non-obsolete* children. There is two common ways to
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   211
achieve this:
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   212
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   213
* Pull a changeset based of an old version of a changeset [#]_.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   214
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   215
* Use a partial rewriting operation. For example amend on a changeset with
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   216
  children .
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   217
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   218
*Non-obsolete* changeset based on *obsolete* one are called **unstable**
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   219
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   220
.. figure:: ./figures/error-unstable.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   221
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   222
    Amend `A` into `A'` leaving `B` behind.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   223
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   224
    In this situation we can not consider `B` as *obsolete*.  But we have all
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   225
    necessary data to detect `B` as an *unstable* branch of the history because
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   226
    its parent `A` is *obsolete*. In addition, we have enough data to
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   227
    automatically resolve this instability: we know that the new version of `B`
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   228
    parent (`A`) is `A'`, We can deduce that we should rebase `B` on `A'` to get
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   229
    a stable history again.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   230
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   231
Proper warning should be issued when part of the history become unstable. UI
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   232
will be able to use the obsolete marker to automatically suggest resolution to
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   233
the user of even carry them out for him.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   234
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   235
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   236
XXX details on automatic resolution for
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   237
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   238
* movement
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   239
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   240
* handling deletion
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   241
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   242
* handling split on multiple head
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   243
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   244
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   245
.. [#] For this to happen one needs to explicitly enable exchange of draft
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   246
       changesets. See phase help for details.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   247
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   248
The two part of the obsolete set
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   249
--------------------------------
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   250
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   251
The previous section show that there can be two kinds of an *obsolete* changeset:
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   252
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   253
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   254
* an *obsolete* changeset with no or *obsolete* only descendants is called **extinct**.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   255
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   256
* an *obsolete* changeset with *unstable* descendants is called **suspended**.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   257
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   258
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   259
.. figure:: ./figures/error-extinct.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   260
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   261
    Amend `A` and `C` leaving `B` behind.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   262
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   263
    In this example we have two *obsolete* changesets: `C` with no *unstable*
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   264
    children is *extinct*. `A` with *unstable* descendant (`B`) is *suspended*.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   265
    `B` is *unstable* as before.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   266
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   267
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   268
Because nothing outside the obsolete set default on *extinct* changesets, they
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   269
can be safely hidden in the UI and even garbage collected. *Suspended* changesets
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   270
have to stay visible and available until their unstable descendant are rewritten
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   271
into stable version.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   272
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   273
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   274
Conflicting rewrites
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   275
---------------------
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   276
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   277
If people start to concurrently edit the same part of the history they will
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   278
likely meet conflicting situations when a changeset has been rewritten in two
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   279
different ways.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   280
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   281
163
92b073d13f2d more doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 161
diff changeset
   282
.. figure:: ./figures/error-conflicting.*
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   283
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   284
    Conflicting rewrite of `A` into `A'` and `A''`
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   285
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   286
This kind of conflict is easy to detect with obsolete markers, because an obsolete
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   287
changeset can have more than one new version. It may be seen as the multiple heads
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   288
case which Mercurial warns you about on pull. It is resolved the same way by a merge of
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   289
A' and A'' that will keep the same parent than `A'` and `A''` with two obsolete
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   290
markers pointing to both `A` and `A'`
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   291
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   292
.. warning::  TODO: Add a schema of the resolution. (merge A' and A'' with A as
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   293
              ancestor and graft the result of A^)
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   294
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   295
Allowing multiple new changesets to obsolete a single one allows to differenciate
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   296
split changesets from history rewriting conflicts.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   297
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   298
Reliable history
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   299
----------------
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   300
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   301
Obsolete marker help to smooth rewriting operation process. However they
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   302
do not change the fact that **you should only rewrite the mutable part of the
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   303
history**. The phase concept enforces this rule by explicitly defining a
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   304
public immutable set of changesets. Rewriting operations refuse to work on
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   305
public changesets, but there are still some corner cases where previously rewritten changesets
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   306
are made public.
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   307
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   308
Special rules apply for obsolete markers pointing to public changesets
161
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   309
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   310
* Public changesets are excluded from the obsolete set (public changeset are
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   311
  never hidden or candidate to garbage collection)
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   312
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   313
* *newer* version of public changeset are said **latecomer** and highlighted as
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   314
  error case.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   315
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   316
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   317
Solving such error is easy. Because we know what changeset a *latecomer* try to
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   318
rewrite, we can easily compute a smaller changeset containing only the change
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   319
from the old *public* to the new *latecomer*.
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   320
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   321
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   322
.. warning:: add a schema
4e3f25ba5401 More doc and index with sphynx
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   323
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   324
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   325
Conclusion
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   326
==========
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   327
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   328
The obsolete marker is a powerful concept that allows mercurial to safely handle
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   329
history rewriting operations. It is a new type of relation between Mercurial
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   330
changesets which tracks the result of history rewriting operations.
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   331
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   332
This concept is simple to define and provides a very solid base for:
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   333
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   334
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   335
- Very fast history rewriting operations,
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   336
175
f86ed5a82723 docs: some fixes on the index and the first half of the obsolete concepts.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
   337
- auditable and reversible history rewriting process,
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   338
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   339
- clean final history,
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   340
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   341
- sharing and collaborating on the mutable part of the history,
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   342
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   343
- gracefully handling history rewriting conflicts,
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   344
176
4da5ecfb5d41 docs: polishing of obs-concept.rst
Arne Babenhauserheide <bab@draketo.de>
parents: 175
diff changeset
   345
- various history rewriting UI’s collaborating with an underlying common API.
166
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   346
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   347
.. list-table:: Comparison on solution [#]_
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   348
   :header-rows: 1
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   349
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   350
   * - Solution
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   351
     - Remove changeset locally
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   352
     - Works on any point of your history
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   353
     - Propagation
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   354
     - Collaboration
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   355
     - Speed
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   356
     - Access to older version
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   357
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   358
   * - Strip
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   359
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   360
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   361
     - \
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   362
     - \ 
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   363
     - \ 
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   364
     - `- -`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   365
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   366
   * - Reference
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   367
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   368
     - \ 
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   369
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   370
     - \ 
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   371
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   372
     - `-`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   373
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   374
   * - Obsolete
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   375
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   376
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   377
     - `++`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   378
     - `++`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   379
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   380
     - `+`
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   381
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   382
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   383
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   384
.. [#] To preserve good tradition in comparison table, an overwhelming advantage
8f8a52cd0b9f big doc update
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 163
diff changeset
   385
       goes to the defended solution.