##// END OF EJS Templates
uncommit: leave empty commit if all files are uncommitted...
Martin von Zweigbergk -
r36990:28ba7d11 default
parent child Browse files
Show More
@@ -166,7 +166,8 b' def uncommit(ui, repo, *pats, **opts):'
166 166
167 167 with repo.transaction('uncommit'):
168 168 match = scmutil.match(old, pats, opts)
169 newid = _commitfiltered(repo, old, match, opts.get('keep'))
169 allowempty = opts.get('keep') or pats
170 newid = _commitfiltered(repo, old, match, allowempty)
170 171 if newid is None:
171 172 ui.status(_("nothing to uncommit\n"))
172 173 return 1
@@ -158,7 +158,7 b' Uncommit with dirty state'
158 158 $ cat files
159 159 abcde
160 160 foo
161 $ hg commit -m "files abcde + foo"
161 $ hg commit --amend -m "files abcde + foo"
162 162
163 163 Testing the 'experimental.uncommitondirtywdir' config
164 164
@@ -188,16 +188,16 b' Uncommit in the middle of a stack, does '
188 188 +abc
189 189
190 190 $ hg bookmark
191 foo 9:48e5bd7cd583
191 foo 10:48e5bd7cd583
192 192 $ hg uncommit
193 193 3 new orphan changesets
194 194 $ hg status
195 195 M files
196 196 A file-abc
197 197 $ hg heads -T '{rev}:{node} {desc}'
198 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol)
198 10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol)
199 199 $ hg bookmark
200 foo 9:48e5bd7cd583
200 foo 10:48e5bd7cd583
201 201 $ hg commit -m 'new abc'
202 202 created new head
203 203
@@ -219,36 +219,38 b' Partial uncommit in the middle, does not'
219 219 +ab
220 220
221 221 $ hg bookmark
222 foo 9:48e5bd7cd583
222 foo 10:48e5bd7cd583
223 223 $ hg uncommit file-ab
224 224 1 new orphan changesets
225 225 $ hg status
226 226 A file-ab
227 227
228 228 $ hg heads -T '{rev}:{node} {desc}\n'
229 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
230 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
231 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
229 12:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
230 11:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
231 10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
232 232
233 233 $ hg bookmark
234 foo 9:48e5bd7cd583
234 foo 10:48e5bd7cd583
235 235 $ hg commit -m 'update ab'
236 236 $ hg status
237 237 $ hg heads -T '{rev}:{node} {desc}\n'
238 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
239 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
240 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
238 13:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
239 11:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
240 10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
241 241
242 242 $ hg log -G -T '{rev}:{node} {desc}' --hidden
243 @ 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
243 @ 13:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
244 244 |
245 o 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
245 o 12:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
246 246 |
247 | * 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
247 | * 11:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
248 248 | |
249 | | * 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
249 | | * 10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
250 250 | | |
251 | | | x 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo
251 | | | x 9:8a6b58c173ca6a2e3745d8bd86698718d664bc6c files abcde + foo
252 | | |/
253 | | | x 8:39ad452c7f684a55d161c574340c5766c4569278 update files for abcde
252 254 | | |/
253 255 | | | x 7:0977fa602c2fd7d8427ed4e7ee15ea13b84c9173 update files for abcde
254 256 | | |/
@@ -270,7 +272,7 b' Uncommit with draft parent'
270 272
271 273 $ hg uncommit
272 274 $ hg phase -r .
273 11: draft
275 12: draft
274 276 $ hg commit -m 'update ab again'
275 277
276 278 Uncommit with public parent
@@ -278,7 +280,7 b' Uncommit with public parent'
278 280 $ hg phase -p "::.^"
279 281 $ hg uncommit
280 282 $ hg phase -r .
281 11: public
283 12: public
282 284
283 285 Partial uncommit with public parent
284 286
@@ -289,9 +291,9 b' Partial uncommit with public parent'
289 291 $ hg status
290 292 A xyz
291 293 $ hg phase -r .
292 15: draft
294 16: draft
293 295 $ hg phase -r ".^"
294 11: public
296 12: public
295 297
296 298 Uncommit leaving an empty changeset
297 299
General Comments 0
You need to be logged in to leave comments. Login now