##// END OF EJS Templates
update: add experimental config for default way of handling dirty wdir...
Martin von Zweigbergk -
r31167:696e321b default
parent child Browse files
Show More
@@ -747,7 +747,10 b' def updatetotally(ui, repo, checkout, br'
747 747 This returns whether conflict is detected at updating or not.
748 748 """
749 749 if updatecheck is None:
750 updatecheck = 'linear'
750 updatecheck = ui.config('experimental', 'updatecheck')
751 if updatecheck not in ('abort', 'none', 'linear'):
752 # If not configured, or invalid value configured
753 updatecheck = 'linear'
751 754 with repo.wlock():
752 755 movemarkfrom = None
753 756 warndest = False
@@ -16,6 +16,21 b''
16 16 $ echo 1.2 > foo
17 17 $ hg ci -Am m
18 18
19 Should respect config to disable dirty update
20 $ hg co -qC 0
21 $ echo 2 > foo
22 $ hg --config experimental.updatecheck=abort pull -u ../tt
23 pulling from ../tt
24 searching for changes
25 adding changesets
26 adding manifests
27 adding file changes
28 added 1 changesets with 1 changes to 1 files (+1 heads)
29 abort: uncommitted changes
30 [255]
31 $ hg --config extensions.strip= strip --no-backup tip
32 $ hg co -qC tip
33
19 34 Should not update to the other topological branch:
20 35
21 36 $ hg pull -u ../tt
@@ -195,6 +195,81 b' Cases are run as shown in that table, ro'
195 195 parent=1
196 196 M foo
197 197
198 $ echo '[experimental]' >> .hg/hgrc
199 $ echo 'updatecheck = abort' >> .hg/hgrc
200
201 $ revtest 'none dirty linear' dirty 1 2
202 abort: uncommitted changes
203 parent=1
204 M foo
205
206 $ revtest 'none dirty linear' dirty 1 2 -c
207 abort: uncommitted changes
208 parent=1
209 M foo
210
211 $ revtest 'none dirty linear' dirty 1 2 -C
212 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 parent=2
214
215 $ echo 'updatecheck = none' >> .hg/hgrc
216
217 $ revtest 'none dirty cross' dirty 3 4
218 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 parent=4
220 M foo
221
222 $ revtest 'none dirty linear' dirty 1 2
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 parent=2
225 M foo
226
227 $ revtest 'none dirty linear' dirty 1 2 -c
228 abort: uncommitted changes
229 parent=1
230 M foo
231
232 $ revtest 'none dirty linear' dirty 1 2 -C
233 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 parent=2
235
236 $ hg co -qC 3
237 $ echo dirty >> a
238 $ hg co --tool :merge3 4
239 merging a
240 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
241 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
242 use 'hg resolve' to retry unresolved file merges
243 [1]
244 $ hg st
245 M a
246 ? a.orig
247 $ cat a
248 <<<<<<< working copy: 6efa171f091b - test: 3
249 three
250 dirty
251 ||||||| base
252 three
253 =======
254 four
255 >>>>>>> destination: d047485b3896 b1 - test: 4
256 $ rm a.orig
257
258 Uses default value of "linear" when value is misspelled
259 $ echo 'updatecheck = linyar' >> .hg/hgrc
260
261 $ revtest 'dirty cross' dirty 3 4
262 abort: uncommitted changes
263 (commit or update --clean to discard changes)
264 parent=3
265 M foo
266
267 Setup for later tests
268 $ revtest 'none dirty linear' dirty 1 2 -c
269 abort: uncommitted changes
270 parent=1
271 M foo
272
198 273 $ cd ..
199 274
200 275 Test updating to null revision
General Comments 0
You need to be logged in to leave comments. Login now