annotate doc/obs-concept.rst @ 149:03f314e32058

import some doc
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 20 Mar 2012 11:02:11 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
149
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
1 =========================
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
2 Obsolete concept
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
3 =========================
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
4
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
5
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
6 Obsolete marker is a powerful concept that allow mercurial to safely handle
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
7 history rewriting operations. It is a new type of relation between Mercurial
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
8 changesets that track the result of history rewriting operations.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
9
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
10 This concept is simple to define and provides a very solid base to:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
11
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
12
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
13 - Very fast history rewriting operations,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
14
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
15 - auditable and reversible history rewritting process,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
16
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
17 - clean final history,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
18
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
19 - share and collaborate on mutable part of the history,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
20
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
21 - gracefully handle history rewriting conflict,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
22
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
23 - allows various history rewriting UI to collaborate with a underlying common API.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
24
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
25
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
26 -----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
27 Basic concept
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
28 -----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
29
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
30
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
31 Every history rewriting operation stores the information that old rewritten
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
32 changesets has newer version available in a set of changeset.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
33
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
34 This simple rules allows to express any possible history rewriting operation:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
35
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
36
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
37
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
38
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
39 .. figure:: ./figures/example-1-update.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
40
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
41 *Updating* a changeset
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
42
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
43 Create one obsolete marker: ``([A'] obsolete A)``
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
44
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
45
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
46
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
47 .. figure:: ./figures/example-2-split.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
48
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
49 *Splitting* a changeset in multiple one
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
50
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
51 Create one obsolete marker ``([B1, B2] obsolete B)]``
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
52
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
53
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
54 .. figure:: ./figures/example-3-merge.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
55
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
56 *Merging* multiple changeset in a single one
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
57
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
58 Create two obsolete markers ``([C] obsolete A), ([C] obsolete B)``
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
59
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
60 .. figure:: ./figures/example-4-reorder.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
61
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
62 *Moving* changeset around
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
63
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
64 Reordering those two changesets need two obsolete markers:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
65 ``([A'] obsolete A), ([B'] obsolete B)``
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
66
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
67
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
68
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
69 .. figure:: ./figures/example-5-delete.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
70
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
71 *Removing* a changeset:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
72
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
73 One obselete marker ``([] obsolete B)``
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
74
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
75
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
76 To conclude, a single obsolete marker express a relation from **0..n** new
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
77 changesets to **1** old changeset.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
78
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
79 -----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
80 Basic Usage
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
81 -----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
82
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
83 Obsolete markers create a perpendicular history: **a versionned version of the
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
84 changeset graph**. This means that we can have the same feature we have for
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
85 versioned files but applied to changeset:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
86
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
87 First: we can display a **coherent view** of the history graph with only a
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
88 single version of your changeset are displayed by the UI.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
89
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
90 Second, because obsolete changeset content are still **available**. You can
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
91
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
92 * **browse** the content of your obsolete commit,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
93
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
94 * **compare** newer and older version of a changeset,
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
95
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
96 * **restore** content of previously obsolete changeset.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
97
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
98 Finally, obsolete marker can be **exchanged between repositories**. You are able to
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
99 share the result on your history rewriting operation with other and **collaborate
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
100 on mutable part of the history**.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
101
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
102 Conflicting history rewriting operation can be detected and **resolved** as easily
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
103 as conflicting changes on file.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
104
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
105
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
106 -----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
107 Detecting and solving tricky situation
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
108 -----------------------------------------------------
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
109
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
110 History rewriting can lead to complex situation. Obsolete marker introduce a
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
111 simple representation this complex reality. But people using complex workflow
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
112 will one day or another you have to face the intrinsics complexity of some
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
113 situation.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
114
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
115 This section describe possible situations, define precise set of changesets
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
116 involved in such situation and explains how error case can we automatically
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
117 resolved using available information.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
118
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
119
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
120 obsolete changesets
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
121 ````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
122
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
123 Old changesets left behind by obsolete operation are said **obsolete**.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
124
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
125 With current version of mercurial, this *obsolete* part is stripped from the
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
126 repository before the end of every rewritting operation.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
127
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
128 .. figure:: ./figures/error-obsolete.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
129
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
130 Rebasing `B` and `C` on `A` (as `B'`, `C'`)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
131
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
132 This rebase operation added two obsolete markers from new changesets to old
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
133 changesets. These Two old changesets are now part of the *obsolete* part of the
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
134 history.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
135
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
136 In most case the obsolete set will be fully hidden to both UI and discovery so
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
137 user do not have to care about them unless he wants to audit history rewriting
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
138 operation.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
139
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
140 Unstable changesets
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
141 ```````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
142
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
143 While exploring obsolete marker possibility a bit further you way end up with
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
144 *obsolete* changeset with *non-obsolete* children. There is two common ways to
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
145 achieve this:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
146
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
147 * Pull a changeset based of an old version of a changeset [#]_.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
148
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
149 * Use a partial rewriting operation. For example amend on a changeset with
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
150 childrens.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
151
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
152 *Non-obsolete* changeset based on *obsolete* one are said **unstable**
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
153
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
154 .. figure:: ./figures/error-unstable.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
155
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
156 Amend `A` into `A'` leaving `B` behind.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
157
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
158 In this situation we can not consider `B` as *obsolete*. But we have all
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
159 necessary data to detect `B` as an *unstable* branch of the history because
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
160 its parent `A` is *obsolete*. In addition, we have enough data to
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
161 automatically resolve this instability: we know that the new version of `B`
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
162 parent (`A`) is `A'`, We can deduce that we should rebase `B` on `A'` to get
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
163 a stable history again.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
164
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
165 Proper warning should be issued when part of the history become unstable. UI
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
166 will be able to use the obsolete marker to automatically suggest resolution to
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
167 the user of even carry them out for him.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
168
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
169
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
170 XXX details automatic resolution for
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
171
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
172 * movement
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
173
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
174 * handling deletion
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
175
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
176 * handling split on multiple head
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
177
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
178
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
179 .. [#] For this to happen one needs to explicitly enable exchange of draft
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
180 changeset. See phase help for details.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
181
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
182 The two part of the obsolete set
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
183 ``````````````````````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
184
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
185 The previous section show that it could be two kinds of *obsolete* changeset:
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
186
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
187
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
188 * *obsolete* changeset with no or *obsolete* only descendants, said **extinct**.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
189
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
190 * *obsolete* changeset with *unstable* descendants, said **suspended**.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
191
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
192
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
193 .. figure:: ./figures/error-extinct.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
194
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
195 Amend `A` and `C` leaving `B` behind.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
196
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
197 In this example we have two *obsolete* changesets: `C` with no *unstable*
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
198 children is *extinct*. `A` with *unstable* descendant (`B`) is *suspended*.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
199 `B` is *unstable* as before.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
200
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
201
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
202 Because nothing outside the obsolete set default on *extinct* changesets, they
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
203 can be safely hidden in the UI and even garbage collected. *Suspended* changeset
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
204 have to stay visible and available until they unstable descendant are rewritten
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
205 in stable version.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
206
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
207
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
208 Conflicting rewriting
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
209 ``````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
210
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
211 If people start to concurrently edit the same part of the history they will
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
212 likely meet conflicting situation when a changeset have been rewritten in two
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
213 different versions.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
214
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
215
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
216 .. figure:: ./figures/error-conflicting.png
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
217
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
218 Conflicting rewriting of `A` into `A'` and `A''`
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
219
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
220 This kind of conflict is easy to detect with obsolete marker because an obsolete
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
221 changeset have more than one new version. It may be seen as the multiple heads
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
222 case Mercurial warn you about on pull. It is resolved the same way by a merge of
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
223 A' and A'' that will keep the same parent than `A'` and `A''` with two obsolete
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
224 markers pointing to both `A` and `A'`
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
225
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
226 .. warning:: TODO: Add a schema of the resolution. (merge A' and A'' with A as
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
227 ancestor and graft the result of A^)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
228
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
229 Allowing multiple new changesets to obsolete a single one allow to distinct a
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
230 splitted changeset from history rewriting conflict.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
231
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
232 Reliable history
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
233 ``````````````````````
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
234
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
235 Obsolete marker really help to smooth rewriting operation process. However they
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
236 do not change the fact that **you should only rewrite the mutable part of the
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
237 history**. The phase concept enforce this rules by explicitly defining a
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
238 public immutable set of changeset. Rewriting operation refuse to work on
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
239 public changeset, but they is still some corner case where changesets
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
240 rewritten in the past are made public.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
241
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
242 Special rules apply for obsolete marker pointing to public changeset
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
243
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
244 * Public changesets are excluded from the obsolete set (public changeset are
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
245 never hidden or candidate to garbage collection)
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
246
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
247 * *newer* version of public changeset are said **latecomer** and highlighted as
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
248 error case.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
249
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
250
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
251 Solving such error is easy. Because we know what changeset a *latecomer* try to
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
252 rewrite, we can easily compute a smaller changeset containing only the change
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
253 from the old *public* to the new *latecomer*.
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
254
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
255
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
256 .. warning:: add a schema
03f314e32058 import some doc
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
257