author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
Thu, 08 Sep 2011 16:44:51 +0200 | |
changeset 48 | 5fd7b64aa8c5 |
parent 36 | 6531b01b2763 |
child 59 | 02fba620d139 |
permissions | -rw-r--r-- |
33 | 1 |
============================= |
2 |
Mutable History For Mercurial |
|
3 |
============================= |
|
4 |
||
35 | 5 |
This repository holds three experimental extensions that introduce concepts |
6 |
related to history rewriting in mercurial. |
|
33 | 7 |
|
8 |
:states: |
|
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 | 12 |
|
13 |
:obsolete: |
|
14 |
||
35 | 15 |
Introduce an ``obsolete`` concept that tracks new versions of rewritten |
16 |
changesets. |
|
33 | 17 |
|
18 |
:rewrite: |
|
35 | 19 |
A collection of commands to rewrite the mutable part of the history. |
33 | 20 |
|
21 |
||
22 |
||
23 |
**These extensions are experimental and are not meant for production.** |
|
24 |
||
25 |
||
26 |
States Extension |
|
35 | 27 |
================ |
33 | 28 |
|
29 |
state: experimentally functional |
|
30 |
||
31 |
(see http://mercurial.selenic.com/wiki/StatesPlan) |
|
32 |
||
35 | 33 |
This extension adds the state concept. A changeset now has one of the following |
34 |
*states*: |
|
33 | 35 |
|
36 |
:published: |
|
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 | 41 |
are published** |
42 |
||
35 | 43 |
* They are exchanged with other repositories (included in pull//push). |
33 | 44 |
|
35 | 45 |
* They are not mutable, extensions rewriting history should refuse to |
33 | 46 |
rewrite them. |
47 |
||
48 |
:ready: |
|
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 | 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 | 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 | 58 |
|
59 |
:draft: |
|
60 |
||
35 | 61 |
Changesets in the ``draft`` state are heavy work in progress you are not |
62 |
yet willing to share with others. |
|
33 | 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 | 66 |
|
67 |
||
35 | 68 |
States of changesets have to be consistent with each other. A ``published`` |
33 | 69 |
changeset can only have ``published`` ancestors. A ``ready`` changeset can only |
35 | 70 |
have ``published`` or ``ready`` ancestors. |
33 | 71 |
|
72 |
||
73 |
Usage and Feature |
|
74 |
------------------ |
|
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 | 80 |
|
35 | 81 |
Changesets will automatically move to ``published`` state when: |
33 | 82 |
|
35 | 83 |
* pushed to a repo that doesn't support the ``ready`` state. |
33 | 84 |
|
85 |
* Tagged by a non local tag. |
|
86 |
||
87 |
Commands |
|
88 |
........ |
|
89 |
||
35 | 90 |
The extension adds a ``hg states`` command to choose which states are used by a |
33 | 91 |
repository, see ``hg help states for details``. |
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 | 96 |
|
97 |
hg ready tip |
|
98 |
||
99 |
Template |
|
100 |
........ |
|
101 |
||
35 | 102 |
A new template keyword ``{state}`` has been added. |
33 | 103 |
|
104 |
Revset |
|
105 |
........ |
|
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 | 109 |
|
110 |
FAQ |
|
111 |
--- |
|
112 |
||
35 | 113 |
Why to you store activate state outside ``.hg/hgrc``? |
114 |
..................................................... |
|
33 | 115 |
|
36
6531b01b2763
Complete a Readme sentence.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
35
diff
changeset
|
116 |
``.hg/hgrc`` might be ignored for trust reason. We don't want the trust issue |
6531b01b2763
Complete a Readme sentence.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
35
diff
changeset
|
117 |
to interfer with enabled state information. |
33 | 118 |
|
35 | 119 |
Why is the ``dead`` state missing? |
120 |
..................................................... |
|
33 | 121 |
|
35 | 122 |
1. The ``dead`` state has a different behaviour that requires more work to be |
123 |
implemented. |
|
33 | 124 |
|
35 | 125 |
2. I believe that the use cases of ``dead changeset`` are better covered by the |
33 | 126 |
``obsolete`` extension. |
127 |
||
128 |
To Do |
|
129 |
----- |
|
130 |
||
48
5fd7b64aa8c5
update README
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
36
diff
changeset
|
131 |
* be robust to unknown changeset in boundary |
5fd7b64aa8c5
update README
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
36
diff
changeset
|
132 |
|
35 | 133 |
* Moving boundary backward (code exists in the ``liquid`` extension done at the |
33 | 134 |
CPH sprint) |
135 |
||
35 | 136 |
* support for default value in configuration (for init and clone) |
33 | 137 |
|
35 | 138 |
* stronger pull//push support (unknown remote heads confuse the current code) |
33 | 139 |
|
35 | 140 |
* display the number of changesets that change state when activating a state. |
33 | 141 |
|
35 | 142 |
* have a switch to select if changesets do change state on state activation. |
33 | 143 |
|
144 |
* proper revset directive. |
|
145 |
||
48
5fd7b64aa8c5
update README
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
36
diff
changeset
|
146 |
- for changeset in states |
5fd7b64aa8c5
update README
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
36
diff
changeset
|
147 |
- for "in use" changeset heads. |
5fd7b64aa8c5
update README
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
36
diff
changeset
|
148 |
|
5fd7b64aa8c5
update README
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
36
diff
changeset
|
149 |
|
33 | 150 |
|
151 |
||
152 |
||
153 |
Obsolete Extension |
|
154 |
====================== |
|
155 |
||
156 |
state: in progress |
|
157 |
||
35 | 158 |
This extension introduces the *obsolete* concept. It adds a new *obsolete* |
159 |
relation between two changesets. A relation ``<changeset B> obsolete <changeset |
|
160 |
A>`` is set to denote that ``<changeset B>`` is new version of ``<changeset |
|
161 |
A>``. |
|
34
f28116682827
Add a few information about obsolete relation.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
33
diff
changeset
|
162 |
|
f28116682827
Add a few information about obsolete relation.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
33
diff
changeset
|
163 |
The *obsolete* relation act as a **perpendicular history** to the standard |
35 | 164 |
changeset history. Standard changeset history versions files. The *obsolete* |
165 |
relation versions changesets. |
|
34
f28116682827
Add a few information about obsolete relation.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
33
diff
changeset
|
166 |
|
33 | 167 |
Usage and Feature |
168 |
------------------ |
|
169 |
||
35 | 170 |
obsolete changesets are hidden. |
33 | 171 |
|
172 |
Commands |
|
173 |
........ |
|
174 |
||
175 |
||
35 | 176 |
a ``debugobsolete`` command has been added. |
33 | 177 |
|
178 |
||
179 |
To Do |
|
180 |
----- |
|
181 |
||
182 |
* do not exchange them |
|
183 |
||
184 |
* handle non-obsolete children |
|
185 |
||
186 |
* exchange the obsolete information |
|
187 |
||
35 | 188 |
* refuse to obsolete published changesets |
33 | 189 |
|
190 |
* handle split |
|
191 |
||
192 |
* handle conflict |
|
193 |
||
194 |
* handle out of sync |
|
195 |
||
196 |
rewrite Extension |
|
197 |
====================== |
|
198 |
||
199 |
state: To be written |
|
200 |