33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
1 =============================
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
2 Mutable History For Mercurial
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
3 =============================
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
4
|
35
|
5 This repository holds three experimental extensions that introduce concepts
|
|
6 related to history rewriting in mercurial.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
7
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
8 :states:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
9
|
35
|
10 Introduce a state concept. It allows to track which changesets have been
|
|
11 made public and immutable and which you want to keep local.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
12
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
13 :obsolete:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
14
|
35
|
15 Introduce an ``obsolete`` concept that tracks new versions of rewritten
|
|
16 changesets.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
17
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
18 :rewrite:
|
35
|
19 A collection of commands to rewrite the mutable part of the history.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
20
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
21
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
22
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
23 **These extensions are experimental and are not meant for production.**
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
24
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
25
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
26 States Extension
|
35
|
27 ================
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
28
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
29 state: experimentally functional
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
30
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
31 (see http://mercurial.selenic.com/wiki/StatesPlan)
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
32
|
35
|
33 This extension adds the state concept. A changeset now has one of the following
|
|
34 *states*:
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
35
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
36 :published:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
37
|
35
|
38 Changesets in the ``published`` state are the core of the history. They are
|
|
39 changesets that you published to the world. People can expect them to always
|
|
40 exist. They are changesets as you know them. **By default all changesets
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
41 are published**
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
42
|
35
|
43 * They are exchanged with other repositories (included in pull//push).
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
44
|
35
|
45 * They are not mutable, extensions rewriting history should refuse to
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
46 rewrite them.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
47
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
48 :ready:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
49
|
35
|
50 Changesets in the ``ready`` state have not yet been accepted in the
|
|
51 immutable history. You can share them with others for review, testing or
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
52 improvement. Any ``ready`` changeset can either be included in the
|
35
|
53 published history (and become immutable) or be rewritten and never make it
|
|
54 to the published history.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
55
|
35
|
56 * They are exchanged with other repositories (included in pull//push).
|
|
57 * They are mutable, extensions rewriting history accept to work on them.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
58
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
59 :draft:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
60
|
35
|
61 Changesets in the ``draft`` state are heavy work in progress you are not
|
|
62 yet willing to share with others.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
63
|
35
|
64 * They are not exchanged with other repositories. pull//push do not see them.
|
|
65 * They are mutable, extensions rewriting history accept to work on them.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
66
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
67
|
35
|
68 States of changesets have to be consistent with each other. A ``published``
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
69 changeset can only have ``published`` ancestors. A ``ready`` changeset can only
|
35
|
70 have ``published`` or ``ready`` ancestors.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
71
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
72
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
73 Usage and Feature
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
74 ------------------
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
75
|
35
|
76 By default all changesets in the repository are ``published``. Other states must
|
|
77 be explicitly activated. When a state is not activated, changesets in this state
|
|
78 are handled as changesets of the state before it (``draft`` are handled as
|
|
79 ``ready``, ``ready`` are handled as ``published``).
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
80
|
35
|
81 Changesets will automatically move to ``published`` state when:
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
82
|
35
|
83 * pushed to a repo that doesn't support the ``ready`` state.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
84
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
85 * Tagged by a non local tag.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
86
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
87 Commands
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
88 ........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
89
|
35
|
90 The extension adds a ``hg states`` command to choose which states are used by a
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
91 repository, see ``hg help states for details``.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
92
|
35
|
93 A command is also added for each active state. The command has the name of the
|
|
94 state and is used to manually change the state of a changeset. This is mainly
|
|
95 useful to move changesets from ``draft`` to ``ready``.::
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
96
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
97 hg ready tip
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
98
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
99 Template
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
100 ........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
101
|
35
|
102 A new template keyword ``{state}`` has been added.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
103
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
104 Revset
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
105 ........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
106
|
35
|
107 We add new ``readyheads()`` and ``publishedheads()`` revset directives. This
|
|
108 returns the heads of each state **as if all of them were activated**.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
109
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
110 FAQ
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
111 ---
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
112
|
35
|
113 Why to you store activate state outside ``.hg/hgrc``?
|
|
114 .....................................................
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
115
|
36
|
116 ``.hg/hgrc`` might be ignored for trust reason. We don't want the trust issue
|
|
117 to interfer with enabled state information.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
118
|
35
|
119 Why is the ``dead`` state missing?
|
|
120 .....................................................
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
121
|
35
|
122 1. The ``dead`` state has a different behaviour that requires more work to be
|
|
123 implemented.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
124
|
35
|
125 2. I believe that the use cases of ``dead changeset`` are better covered by the
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
126 ``obsolete`` extension.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
127
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
128 To Do
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
129 -----
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
130
|
35
|
131 * Moving boundary backward (code exists in the ``liquid`` extension done at the
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
132 CPH sprint)
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
133
|
35
|
134 * support for default value in configuration (for init and clone)
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
135
|
35
|
136 * stronger pull//push support (unknown remote heads confuse the current code)
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
137
|
35
|
138 * display the number of changesets that change state when activating a state.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
139
|
35
|
140 * have a switch to select if changesets do change state on state activation.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
141
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
142 * proper revset directive.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
143
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
144
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
145
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
146
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
147 Obsolete Extension
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
148 ======================
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
149
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
150 state: in progress
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
151
|
35
|
152 This extension introduces the *obsolete* concept. It adds a new *obsolete*
|
|
153 relation between two changesets. A relation ``<changeset B> obsolete <changeset
|
|
154 A>`` is set to denote that ``<changeset B>`` is new version of ``<changeset
|
|
155 A>``.
|
34
|
156
|
|
157 The *obsolete* relation act as a **perpendicular history** to the standard
|
35
|
158 changeset history. Standard changeset history versions files. The *obsolete*
|
|
159 relation versions changesets.
|
34
|
160
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
161 Usage and Feature
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
162 ------------------
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
163
|
35
|
164 obsolete changesets are hidden.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
165
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
166 Commands
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
167 ........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
168
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
169
|
35
|
170 a ``debugobsolete`` command has been added.
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
171
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
172
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
173 To Do
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
174 -----
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
175
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
176 * do not exchange them
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
177
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
178 * handle non-obsolete children
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
179
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
180 * exchange the obsolete information
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
181
|
35
|
182 * refuse to obsolete published changesets
|
33
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
183
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
184 * handle split
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
185
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
186 * handle conflict
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
187
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
188 * handle out of sync
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
189
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
190 rewrite Extension
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
191 ======================
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
192
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
193 state: To be written
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
194
|