comparison tests/test-merge1.t @ 27657:7b5c8c8a2f8c

merge: add options to warn or ignore on colliding unknown files A 'colliding unknown file' is a file that meets all of the following conditions: - is untracked or ignored on disk - is present in the changeset being merged or updated to - has different contents Previously, we would always abort whenever we saw such files. With this config option we can choose to warn and back the unknown files up instead, or even forgo the warning entirely and silently back the unknown files up. Common use cases for this configuration include a large scale transition of formerly ignored unknown files to tracked files. In some cases the files can be given new names, but in other cases, external "convention over configuration" constraints have determined that the file must retain the same name as before.
author Siddharth Agarwal <sid0@fb.com>
date Sat, 02 Jan 2016 03:11:52 -0800
parents 6a6e78f84cc6
children 6b639caa1652
comparison
equal deleted inserted replaced
27656:57c0d4888ca8 27657:7b5c8c8a2f8c
122 122
123 $ rm b 123 $ rm b
124 $ echo This is file b2 > b 124 $ echo This is file b2 > b
125 #endif 125 #endif
126 126
127 merge of b expected 127 bad config
128 $ hg merge 1 --config merge.checkunknown=x
129 abort: merge.checkunknown not valid ('x' is none of 'abort', 'ignore', 'warn')
130 [255]
131 this merge should fail
132 $ hg merge 1 --config merge.checkunknown=abort
133 b: untracked file differs
134 abort: untracked files in working directory differ from files in requested revision
135 [255]
136
137 this merge should warn
138 $ hg merge 1 --config merge.checkunknown=warn
139 b: replacing untracked file
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 (branch merge, don't forget to commit)
142 $ cat b.orig
143 This is file b2
144 $ hg up --clean 2
145 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
146 $ mv b.orig b
147
148 this merge should silently ignore
149 $ cat b
150 This is file b2
151 $ hg merge 1 --config merge.checkunknown=ignore
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 (branch merge, don't forget to commit)
154
155 $ cat b.orig
156 This is file b2
157 $ hg up --clean 2
158 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
159 $ mv b.orig b
160
161 this merge of b should work
162 $ cat b
163 This is file b2
128 $ hg merge -f 1 164 $ hg merge -f 1
129 merging b 165 merging b
130 merging for b 166 merging for b
131 0 files updated, 1 files merged, 0 files removed, 0 files unresolved 167 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
132 (branch merge, don't forget to commit) 168 (branch merge, don't forget to commit)