docs/instability.rst
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 26 Jun 2012 11:29:51 +0200
changeset 309 de21685d22d1
parent 243 2f68c708e10b
child 357 b398e9c2dbd1
permissions -rw-r--r--
evolve: warn when latecomer changeset are created
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
     1
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
-----------------------------------
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
     3
The instability Principle
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
-----------------------------------
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     8
An intrinsic contradiction
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
-----------------------------------
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    11
XXX starts by talking about getting ride of changeset.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
DVCS bring two new major concepts to the Version Control Scene:
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    14
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    15
    * History is organized as a robust DAG,
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    16
    * History can be rewritten.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    17
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    18
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    19
However, the two concepts are in contradiction:
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    20
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    21
To achieve a robust history, three key elements are gathered in *changeset*:
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    22
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    23
    * Full snapshot of the versioned content,
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    24
    * Reference to the previous full snapshot used to build the new one,
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    25
    * A description of the change who lead from the old content to the new old.
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    26
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    27
All three elements are to compute a *unique* hash that identify the changeset
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
(with various other metadata). This identification is a key part of DVCS design.
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    29
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    30
This is a very useful property because Changing B parent means changing B
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    31
content too.  This require the creation of **another** changeset which is a good
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    32
semantic.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    33
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    34
::
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    35
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
  Schema base,  A, B and B'
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    38
To avoid duplication, the older changeset is usually discarded from accessible
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    39
history. I'm calling them *obsolete* changesets.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    40
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    41
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    42
But rewriting a changeset with children does not changes children parent! And
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    43
because children of the rewritten changeset still **depends** on the older
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    44
"dead" version of the changeset with can not get ride of this dead version.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    45
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    46
::
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    47
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    48
  Schema base,  A and A' and B.
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    49
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    50
I'm calling those children **unstable** because they are based one a dead
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    51
changeset and prevent people to get ride of it.
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    52
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    53
This instability is an **unavoidable consequence** of the strict dependency of
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    54
changeset.  History Rewriting history alway  need to take it in account and
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    55
provide a way to rewrite the descendant on the new changeset to avoid
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    56
coexistence of the old and new version of a rewritten changeset..
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    57
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    58
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    59
Everybody is working around the issue
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    60
------------------------------------------------
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    61
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    62
I'm not claiming that rewriting history is impossible. People are successfully
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    63
doing for years. However they all need to work around *instability*. Several
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    64
work around strategy exists.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    65
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    66
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    67
Rewriting all at once
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    68
``````````````````````````
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    69
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    70
The simplest way to avoid instability is to ensure rewriting operation always
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    71
ends in a stable situation. This is achieve by rewriting all impacted changeset
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    72
at the same time.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    73
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    74
Rewriting all descendants at the same time than the rewritted of a changeset.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    75
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    76
::
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    77
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    78
  Schema!
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    79
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    80
Several Mercurial commands apply it: rebase, collapse, histedit.  Mercurial also
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    81
refuse to amend changeset with descendant.  The git branch design enforce such
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    82
approach in git too.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    83
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    84
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    85
However, DVCS are **Distributed**. This means that you do not control what
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    86
happen outside your repository. Once a changeset have been exchanged *outside*,
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    87
there is no way to be sure it does not have descendants somewhere else.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    88
Therefore **if you rewrite changeset that exists elsewhere, you can't eradicate
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    89
the risk of instability.**
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    90
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    91
Do not rewrite exchanged changeset
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    92
```````````````````````````````````
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    93
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    94
To work around the issue above, mercurial introduced phases that prevent you to
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    95
rewrite shared changeset and ensure other can't pull certain changeset from you.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    96
But this is a very frustrating limitation that prevent you to efficiently share,
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    97
review and collaborate on mutable changeset.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    98
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
    99
Git world use another approach to prevent instability.  By convention only a
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   100
single developper works on a changeset contained in a named branch. But once
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   101
again this is a huge blocker for collaborating. Moreover clueless people
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   102
**will** mess up social convention soon or later.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   103
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   104
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   105
Loose the DAG robustness
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   106
````````````````````````````
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   107
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   108
The other approach use in Mercurial is to keep the mutable part of the history
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   109
outside the DVCS constraint. This is the MQ approach of sticking a quilt queue
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   110
over Mercurial.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   111
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   112
This allow much more flexible workflow but two major feature are lost in the
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   113
process:
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   114
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   115
:Graceful merge: MQ use plain-patch to store changeset content and patch have
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   116
                 trouble to apply in changing context. Applying your queue
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   117
                 becomes very painful when context changes.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   118
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   119
:easy branching: A quilt queue is by definition a linear queue. Increasing risk
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   120
                 of conflict
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   121
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   122
It is possible to collaborate over versioned mq! But you are going ahead a lot
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   123
of troubles.
228
5a17c0d41a00 proof-read documentation and docstrings
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 227
diff changeset
   124
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   125
.. Ignore conflicts
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   126
.. ```````````````````````````````````
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   127
.. 
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   128
.. Another ignored issue is conflicting rewritting of the same changeset. If a
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   129
.. changeset is rewritten two times we have two newer version, duplicated history
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   130
.. complicate to merge.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   131
.. 
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   132
.. Mercurial work around by
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   133
.. 
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   134
.. The "One set of mutable changset == One developper" mantra is also a way to work
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   135
.. around conflicting rewritting of changeset. If two different people are able to
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   136
.. 
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   137
.. The git branch model allow to overwrite changeset version by another one. But it
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   138
.. does not care about divergent version. It is the equilent of "common ftp" source
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   139
.. management for changeset.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   140
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   141
Facing The Danger Once And For All
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   142
------------------------------------------------
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   143
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   144
Above we saw that, the more effort you put to avoid instability, the more option
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   145
you deny. And even most restrictive work flow can't guarantee that instability
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   146
will never show up!
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   147
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   148
Obsolete marker can handle the job
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   149
```````````````````````````````````
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   150
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   151
It is time to provide a full featured solution to deal with instability and to
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   152
stop working around the issue! This is why I developing a new feature for
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   153
mercurial called "Obsolete markers". Obsolete markers have two key properties:
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   154
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   155
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   156
* Any "old" changeset we want to get ride of is **explicitly** marked as "obsolete"
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   157
  by history rewriting operation.
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   158
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   159
  By explicitly marking the obsolete part of the history, we will be able to
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   160
  easily detect instability situation.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   161
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   162
* Relations between old and new version of changesets are tracked by obsolete
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   163
  markers.
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   164
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   165
  By Storing a meta-history of changeset evolution we are able to easily resolve
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   166
  instability and edition conflict [#]_ .
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   167
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   168
.. [#] edition conflict is another major obstable to collaboration. See the
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   169
       section dedicated to obsolete marker for details.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   170
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   171
Improves robustness == improves simplicity
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   172
````````````````````````````````````````````````
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   173
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   174
This proposal should **first** be seen as a safety measure.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   175
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   176
It allow to detect instability as soon as possible
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   177
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   178
::
240
ab9ee2eba21e [doc] fix unstable code block
Pierre-Yves.David@ens-lyon.org
parents: 231
diff changeset
   179
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   180
    $ hg pull
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   181
    added 3 changeset
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   182
    +2 unstable changeset
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   183
    (do you want "hg stabilize" ?)
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   184
    working directory parent is obsolete!
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   185
    $ hg push
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   186
    outgoing unstable changesets
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   187
    (use "hg stabilize" or force the push)
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   188
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   189
And should not not encourage people to create unstability
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   190
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   191
::
240
ab9ee2eba21e [doc] fix unstable code block
Pierre-Yves.David@ens-lyon.org
parents: 231
diff changeset
   192
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   193
    $ hg up 42
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   194
    $ hg commit --amend
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   195
    changeset have descendant.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   196
    $ hg commit --amend -f
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   197
    +5 unstable changeset
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   198
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   199
    $ hg rebase -D --rev 40::44
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   200
    rebasing already obsolete changeset 42:AAA will conflict with newer version 48:BBB
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   201
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   202
While allowing powerful feature
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   203
````````````````````````````````````````````````
221
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   204
d43b72724b84 doc: unstability principle
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   205
231
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   206
* Help to automatically solve instability.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   207
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   208
* "kill" changeset remotely.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   209
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   210
* track resulting changeset when submitting patch//pull request.
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   211
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   212
* Focus on what you do:
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   213
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   214
  I do not like the "all at once" model of history rewriting. I'm comfortable
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   215
  with unstability and obsolete marker offer all the tool to safely create and
f589d054329a restore unstability content
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 228
diff changeset
   216
  handle unstability locally.
228
5a17c0d41a00 proof-read documentation and docstrings
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 227
diff changeset
   217
5a17c0d41a00 proof-read documentation and docstrings
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 227
diff changeset
   218