##// END OF EJS Templates
uncommit: add an experimental.uncommitondirtywdir config...
Pulkit Goyal -
r34286:7b1e524a default
parent child Browse files
Show More
@@ -149,7 +149,8 b' def uncommit(ui, repo, *pats, **opts):'
149 with repo.wlock(), repo.lock():
149 with repo.wlock(), repo.lock():
150 wctx = repo[None]
150 wctx = repo[None]
151
151
152 if not pats:
152 if not pats and not repo.ui.configbool('experimental',
153 'uncommitondirtywdir', False):
153 cmdutil.bailifchanged(repo)
154 cmdutil.bailifchanged(repo)
154 if wctx.parents()[0].node() == node.nullid:
155 if wctx.parents()[0].node() == node.nullid:
155 raise error.Abort(_("cannot uncommit null changeset"))
156 raise error.Abort(_("cannot uncommit null changeset"))
@@ -158,6 +158,15 b' Uncommit with dirty state'
158 foo
158 foo
159 $ hg commit -m "files abcde + foo"
159 $ hg commit -m "files abcde + foo"
160
160
161 Testing the 'experimental.uncommitondirtywdir' config
162
163 $ echo "bar" >> files
164 $ hg uncommit
165 abort: uncommitted changes
166 [255]
167 $ hg uncommit --config experimental.uncommitondirtywdir=True
168 $ hg commit -m "files abcde + foo"
169
161 Uncommit in the middle of a stack, does not move bookmark
170 Uncommit in the middle of a stack, does not move bookmark
162
171
163 $ hg checkout '.^^^'
172 $ hg checkout '.^^^'
@@ -177,15 +186,15 b' Uncommit in the middle of a stack, does '
177 +abc
186 +abc
178
187
179 $ hg bookmark
188 $ hg bookmark
180 foo 8:83815831694b
189 foo 9:48e5bd7cd583
181 $ hg uncommit
190 $ hg uncommit
182 $ hg status
191 $ hg status
183 M files
192 M files
184 A file-abc
193 A file-abc
185 $ hg heads -T '{rev}:{node} {desc}'
194 $ hg heads -T '{rev}:{node} {desc}'
186 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo (no-eol)
195 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol)
187 $ hg bookmark
196 $ hg bookmark
188 foo 8:83815831694b
197 foo 9:48e5bd7cd583
189 $ hg commit -m 'new abc'
198 $ hg commit -m 'new abc'
190 created new head
199 created new head
191
200
@@ -207,34 +216,36 b' Partial uncommit in the middle, does not'
207 +ab
216 +ab
208
217
209 $ hg bookmark
218 $ hg bookmark
210 foo 8:83815831694b
219 foo 9:48e5bd7cd583
211 $ hg uncommit file-ab
220 $ hg uncommit file-ab
212 $ hg status
221 $ hg status
213 A file-ab
222 A file-ab
214
223
215 $ hg heads -T '{rev}:{node} {desc}\n'
224 $ hg heads -T '{rev}:{node} {desc}\n'
216 10:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
225 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
217 9:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
226 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
218 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo
227 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
219
228
220 $ hg bookmark
229 $ hg bookmark
221 foo 8:83815831694b
230 foo 9:48e5bd7cd583
222 $ hg commit -m 'update ab'
231 $ hg commit -m 'update ab'
223 $ hg status
232 $ hg status
224 $ hg heads -T '{rev}:{node} {desc}\n'
233 $ hg heads -T '{rev}:{node} {desc}\n'
225 11:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
234 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
226 9:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
235 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
227 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo
236 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
228
237
229 $ hg log -G -T '{rev}:{node} {desc}' --hidden
238 $ hg log -G -T '{rev}:{node} {desc}' --hidden
230 @ 11:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
239 @ 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
231 |
240 |
232 o 10:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
241 o 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
233 |
242 |
234 | o 9:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
243 | o 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
235 | |
244 | |
236 | | o 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo
245 | | o 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
237 | | |
246 | | |
247 | | | x 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo
248 | | |/
238 | | | x 7:0977fa602c2fd7d8427ed4e7ee15ea13b84c9173 update files for abcde
249 | | | x 7:0977fa602c2fd7d8427ed4e7ee15ea13b84c9173 update files for abcde
239 | | |/
250 | | |/
240 | | o 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde
251 | | o 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde
@@ -255,7 +266,7 b' Uncommit with draft parent'
255
266
256 $ hg uncommit
267 $ hg uncommit
257 $ hg phase -r .
268 $ hg phase -r .
258 10: draft
269 11: draft
259 $ hg commit -m 'update ab again'
270 $ hg commit -m 'update ab again'
260
271
261 Uncommit with public parent
272 Uncommit with public parent
@@ -263,7 +274,7 b' Uncommit with public parent'
263 $ hg phase -p "::.^"
274 $ hg phase -p "::.^"
264 $ hg uncommit
275 $ hg uncommit
265 $ hg phase -r .
276 $ hg phase -r .
266 10: public
277 11: public
267
278
268 Partial uncommit with public parent
279 Partial uncommit with public parent
269
280
@@ -274,9 +285,9 b' Partial uncommit with public parent'
274 $ hg status
285 $ hg status
275 A xyz
286 A xyz
276 $ hg phase -r .
287 $ hg phase -r .
277 14: draft
288 15: draft
278 $ hg phase -r ".^"
289 $ hg phase -r ".^"
279 10: public
290 11: public
280
291
281 Uncommit leaving an empty changeset
292 Uncommit leaving an empty changeset
282
293
General Comments 0
You need to be logged in to leave comments. Login now