comparison tests/test-backout.t @ 23615:7cfe58983bff

backout: add --commit option Mercurial backout command makes a commmit by default only when the backed out revision is the parent of working directory and doesn't commit in any other case. The --commit option changes behaviour of backout to make a commit whenever possible (i.e. there is no unresolved conflicts). This behaviour seems more intuitive to many use (especially git users migrating to hg).
author Mateusz Kwapich <mitrandir@fb.com>
date Wed, 17 Dec 2014 17:26:12 -0800
parents b081decd9062
children 1ef96a3b8b89
comparison
equal deleted inserted replaced
23614:cd79fb4d75fd 23615:7cfe58983bff
39 $ hg summary 39 $ hg summary
40 parent: 2:2929462c3dff tip 40 parent: 2:2929462c3dff tip
41 Backed out changeset a820f4f40a57 41 Backed out changeset a820f4f40a57
42 branch: default 42 branch: default
43 commit: (clean) 43 commit: (clean)
44 update: (current)
45
46 commit option
47
48 $ cd ..
49 $ hg init commit
50 $ cd commit
51
52 $ echo tomatoes > a
53 $ hg add a
54 $ hg commit -d '0 0' -m tomatoes
55
56 $ echo chair > b
57 $ hg add b
58 $ hg commit -d '1 0' -m chair
59
60 $ echo grapes >> a
61 $ hg commit -d '2 0' -m grapes
62
63 $ hg backout --commit -d '4 0' 1 --tool=:fail
64 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
65 changeset 3:1c2161e97c0a backs out changeset 1:22cb4f70d813
66 $ hg summary
67 parent: 3:1c2161e97c0a tip
68 Backed out changeset 22cb4f70d813
69 branch: default
70 commit: (clean)
71 update: (current)
72
73 $ echo ypples > a
74 $ hg commit -d '5 0' -m ypples
75
76 $ hg backout --commit -d '6 0' 2 --tool=:fail
77 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
78 use 'hg resolve' to retry unresolved file merges
79 [1]
80 $ hg summary
81 parent: 4:ed99997b793d tip
82 ypples
83 branch: default
84 commit: 1 unresolved (clean)
44 update: (current) 85 update: (current)
45 86
46 file that was removed is recreated 87 file that was removed is recreated
47 (this also tests that editor is not invoked if the commit message is 88 (this also tests that editor is not invoked if the commit message is
48 specified explicitly) 89 specified explicitly)