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 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
5 |
This repository hold several experimental extension that introduce concept
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
6 |
related to history rewriting in mercurial. You will find three different
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
7 |
extensions.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
8 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
9 |
:states:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
10 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
11 |
Introduce a state concept. It allow to track which changeset have been make
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
12 |
public and immutable and which you want to keep local.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
13 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
14 |
:obsolete:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
15 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
16 |
Introduce an obsolete concept that track new version of rewritten changeset.
|
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:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
19 |
A collection of command to rewrite the mutable part of the history.
|
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
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
27 |
======================
|
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 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
33 |
This extension the state concept. A changeset now have one of the following *state*:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
34 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
35 |
:published:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
36 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
37 |
Changeset in the ``published`` state are the core of the history. They are
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
38 |
changeset that you published to the world. People can expect them to always
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
39 |
be exist. This is changeset as you know them. **By default all changeset
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
40 |
are published**
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
41 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
42 |
* They are exchanged with other repository (included in pull//push).
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
43 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
44 |
* They are not mutable, extension rewriting history should refuse to
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
45 |
rewrite them.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
46 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
47 |
:ready:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
48 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
49 |
Changeset in the ``ready`` state have not been accepted in the immutable
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
50 |
history yet. You can share them with other for review, testing or
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
51 |
improvement. Any ``ready`` changeset can either be included in the
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
52 |
published history (and become immutable) or be rewritten and rever make it
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
53 |
the published history.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
54 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
55 |
* They are exchanged with other repository (included in pull//push).
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
56 |
* They are mutable, extension rewriting history accept to work on them.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
57 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
58 |
:draft:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
59 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
60 |
Changeset in the ``draft`` state are heavy work in progress you are
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
61 |
currently working on without willing to share with other.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
62 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
63 |
* They are not exchanged with other repository. pull//push does not see them.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
64 |
* They are mutable, extension rewriting history accept to work on them.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
65 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
66 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
67 |
State of changeset have to be consistent with each other. A ``published``
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
68 |
changeset can only have ``published`` ancestors. A ``ready`` changeset can only
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
69 |
have ``published`` or ready ancestor.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
70 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
71 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
72 |
Usage and Feature
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
73 |
------------------
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
74 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
75 |
By default all changeset in the repository are ``published``. Other state must
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
76 |
be explicitly activated. When a state is not activated, changeset of this state
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
77 |
are handled as changeset of the state before him. (``draft`` are handled as
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
78 |
``ready``, ``ready`` are handled as ``published``)
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
79 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
80 |
Changeset will automatically move to ``published`` state when:
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
81 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
82 |
* pushed to a repo that doesn't support ``ready`` state.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
83 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
84 |
* Tagged by a non local tag.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
85 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
86 |
Commands
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
87 |
........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
88 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
89 |
The extension add and ``hg states`` command to choose which state are used by a
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
90 |
repository, see ``hg help states for details``.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
91 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
92 |
A command is also added for all active states. The command have the name of the
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
93 |
states and is used to manually change the state of a changeset. This is mainly
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
94 |
usefull to move changeset from ``draft`` to ``ready``.::
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
95 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
96 |
hg ready tip
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
97 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
98 |
Template
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
99 |
........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
100 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
101 |
A new template keyword ``{state}`` have been added
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
102 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
103 |
Revset
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
104 |
........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
105 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
106 |
We add a new ``readyheads()`` and ``publishedheads()`` revset directive. This return the heads of each states **as if all of them was activated**.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
107 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
108 |
FAQ
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
109 |
---
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
110 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
111 |
Why to you store activate state ouside ``.hg/hgrc``
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
112 |
....................................................
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
113 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
114 |
``.hg/hgrc`` might be ignored for trust reason. we don't want the
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
115 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
116 |
Why is the ``dead`` state missing
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
117 |
....................................................
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
118 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
119 |
1. The ``dead`` state have a different behaviour that require more work to be
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
120 |
implemented
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
121 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
122 |
2. I believe that the usecase of ``dead changeset`` are better covered by the
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
123 |
``obsolete`` extension.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
124 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
125 |
To Do
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
126 |
-----
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
127 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
128 |
* Moving boundary backward (code existist in ``liquid`` extension done at the
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
129 |
CPH sprint)
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
130 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
131 |
* support for default value in configuration (when for init and clone)
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
132 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
133 |
* stronger pull//push support (unknown remote head confuse the current code)
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
134 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
135 |
* display the number of changeset that change state when activating a state.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
136 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
137 |
* have a switch to select if changeset do change state on state activation.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
138 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
139 |
* proper revset directive.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
140 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
141 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
142 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
143 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
144 |
Obsolete Extension
|
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 |
state: in progress
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
148 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
149 |
Usage and Feature
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
150 |
------------------
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
151 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
152 |
obsolete changeset are hidden.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
153 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
154 |
Commands
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
155 |
........
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
156 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
157 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
158 |
a ``debugobsolete`` command have been added.
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
159 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
160 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
161 |
To Do
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
162 |
-----
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
163 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
164 |
* do not exchange them
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
165 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
166 |
* handle non-obsolete children
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
167 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
168 |
* exchange the obsolete information
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
169 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
170 |
* refuse to obsolete published changeset
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
171 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
172 |
* handle split
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
173 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
174 |
* handle conflict
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
175 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
176 |
* handle out of sync
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
177 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
178 |
rewrite Extension
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
179 |
======================
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
180 |
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
181 |
state: To be written
|
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
182 |
|