1 ======================================== |
|
2 Introduction to the evolution extension |
|
3 ======================================== |
|
4 |
|
5 An history rewriting extension |
|
6 |
|
7 * Using the obsolete marker concept |
|
8 |
|
9 * Inspired from mq |
|
10 |
|
11 it is simple to enable:: |
|
12 |
|
13 $ hg clone http://hg-dev.octopoid.net/hgwebdir.cgi/mutable-history/ |
|
14 $ mutable-history/enable.sh > ~/.hgrc |
|
15 |
|
16 |
|
17 |
|
18 Quick Guide |
|
19 ===================================================================== |
|
20 |
|
21 |
|
22 |
|
23 Add a changeset: ``commit`` |
|
24 ------------------------------------------------------------ |
|
25 |
|
26 Just use commit as usual. |
|
27 |
|
28 Rewrite a changeset: ``amend`` |
|
29 ------------------------------------------------------------ |
|
30 |
|
31 A new command ``hg amend`` is added by the extension. it write a new changeset |
|
32 combining working-directory parent changes and working directory parent changes. |
|
33 |
|
34 To understand what the result of amend will be I do use the two following |
|
35 aliases [#]_:: |
|
36 |
|
37 # diff what amend will look likes |
|
38 pdiff=diff --rev .^ |
|
39 |
|
40 # status what amend will look likes |
|
41 pstatus=status --rev .^ |
|
42 |
|
43 It take various options to choose the user, the date and the branch of the |
|
44 result. see ``hg help amend for detail`` |
|
45 |
|
46 This command can be invoqued on any mutable changeset even changeset with |
|
47 children ! |
|
48 |
|
49 |
|
50 .. note:: the amend command is very similar to mq's ``qrefresh``, a ``refresh`` |
|
51 alias for amend is also available. But note that contrary to |
|
52 ``qrefresh``, ``amend`` does not exclude changes on file not specified |
|
53 on the command line. |
|
54 |
|
55 XXX add idank example |
|
56 |
|
57 |
|
58 .. [#] (added by enable.sh) |
|
59 |
|
60 |
|
61 |
|
62 Move a changeset: ``graft`` |
|
63 ------------------------------------------------------------ |
|
64 |
|
65 the graft command introduced in 2.0 allows to "copy changes from other branches |
|
66 onto the current branch" |
|
67 |
|
68 The graft command have been altered to be able to create an obsolete marker from |
|
69 the copy result to the copy source, acting like changeset movement operation. |
|
70 This is achieved using a new flag `-O` (or `old-obsolete`) [#]_. |
|
71 |
|
72 |
|
73 XXX example |
|
74 |
|
75 .. warning:: when using graft --continue after conflict resolution you **MUST** |
|
76 pass `-O` or `-o` flag again because they are not saved for now |
|
77 |
|
78 |
|
79 .. [#] add this `-O` to graft instead of a dedicated command is probably |
|
80 abusive. But this was very convenient for experimental purpose. |
|
81 This will likely change in non experimental release. |
|
82 |
|
83 Delete a changeset: ``kill`` |
|
84 ------------------------------------------------------------ |
|
85 |
|
86 A new ``kill`` command allow to remove a changeset. |
|
87 |
|
88 Just use ``hg kill <some-rev>``. |
|
89 |
|
90 Moving within the history: ``up`` ``gdown`` and ``gup`` |
|
91 ------------------------------------------------------------ |
|
92 |
|
93 While working on mutable part of the history you often need to move between |
|
94 mutable commit. |
|
95 |
|
96 You just need to use standard update to work with evolve. For convenience, you |
|
97 can use ``hg gup`` to move to children commit or ``hg gdown`` to move to working |
|
98 directory parent commit. |
|
99 |
|
100 .. note:: those command only exist for the convenience of getting qpush and qpop |
|
101 feeling back. |
|
102 |
|
103 They are |
|
104 |
|
105 collapse changesets: ``amend`` |
|
106 ------------------------------------------------------------ |
|
107 |
|
108 you can use amend -c to collapse multiple changeset in a single one. |
|
109 |
|
110 Move multiple changesets: ``rebase`` |
|
111 ------------------------------------------------------------ |
|
112 |
|
113 You can still use rebase to move whole part of the changeset graph at once. |
|
114 |
|
115 .. warning:: Beware that rebasing obsolete changeset will result in new |
|
116 conflicting version. |
|
117 |
|
118 Stabilize history: ``stabilize`` |
|
119 ------------------------------------------------------------ |
|
120 |
|
121 When you rewrite changeset with children without rewriting those children you |
|
122 create *unstable* changeset and *suspended obsolete* changeset |
|
123 |
|
124 .. warning:: ``hg stabilize`` have no --continue to use after conflict |
|
125 resolution. is conflict occurs use:: |
|
126 |
|
127 $ hg up -C . # cancel the failed merge |
|
128 $ hg stabilize -n # go get a command to execute |
|
129 |
|
130 .. warning:: stabilization does not handle deletion yet. |
|
131 |
|
132 .. warning:: obsolete currently rely on secret changeset to not exchange |
|
133 obsolete and unstable changeset. |
|
134 |
|
135 XXX details issue here |
|
136 |
|
137 |
|
138 Fix my history afterward: ``kill -n`` |
|
139 ------------------------------------------------------------ |
|
140 |
|
141 sometime you need to create obsolete marker by hand. This may happen when |
|
142 upstream applied some of you patches for example. |
|
143 |
|
144 you can use ``hg kill --new <new-changeset> <old-changeset>`` to add obsolete |
|
145 marker. |
|
146 |
|
147 export to mq: ``synchronize`` |
|
148 ------------------------------------------------------------ |
|
149 |
|
150 Another extension allows to export |
|
151 |
|
152 view change to your file |
|
153 ------------------------------------------------------------ |
|
154 |
|
155 Another extension allows to export |
|
156 |
|
157 view diff from the last amend |
|
158 ------------------------------------------------------------ |
|
159 |
|
160 an odiff alias have been added by enable.sh |
|
161 |
|
162 :: |
|
163 [alias] |
|
164 odiff = diff --rev 'limit(obsparents(.),1)' --rev . |
|
165 |
|
166 view obsolete marker |
|
167 ------------------------------------------------------------ |
|
168 |
|
169 hgview is the only viewer that support this feature. you need an experimental |
|
170 version available here: |
|
171 |
|
172 $ hg clone http://hg-dev.octopoid.net/hgwebdir.cgi/hgview/ |
|
173 |
|
174 Prevent my unfinished changeset to get published |
|
175 ------------------------------------------------------------ |
|
176 |
|
177 The easiest way is to set them in the private phase |
|
178 |
|
179 Important Note |
|
180 ===================================================================== |
|
181 |
|
182 view change to your file |
|
183 ------------------------------------------------------------ |
|
184 |
|
185 extinct changeset are hidden using the *hidden* feature of mercurial. |
|
186 |
|
187 only hg log and hgview support it. hg glog or other visual viewer don't. |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|