comparison tests/test-mq.t @ 16634:435375cc0ca0 stable

mq: backup local changes in qpush --force qpush help says the following about --force: 1- When -f/--force is applied, all local changes in patched files will be lost. 2- Apply on top of local changes In practice, qpush --force will attempt to apply the patch on top of local changes, and on success will merge them in the pushed patch. On failure, patched files will contain a mix of local changes (where the patch could not apply) and a mix of patch changes (were it applied). So, local changes are less lost than entangled with a mass of other changes. This patch makes qpush --force backup all locally modified files touched by the next patch being applied. When multiple patches are being pushed, this logic is repeated for each patch. Note that modified but successfully patched files are preserved as well.
author Patrick Mezard <patrick@mezard.eu>
date Fri, 11 May 2012 16:18:47 +0200
parents 41b41adba08a
children 4ae3ba9e4d7a
comparison
equal deleted inserted replaced
16633:b2ca2f40c9c1 16634:435375cc0ca0
1354 [255] 1354 [255]
1355 1355
1356 1356
1357 apply force, should discard changes in hello, but not bye 1357 apply force, should discard changes in hello, but not bye
1358 1358
1359 $ hg qpush -f 1359 $ hg qpush -f --verbose
1360 applying empty 1360 applying empty
1361 saving current version of hello.txt as hello.txt.orig
1362 patching file hello.txt
1363 hello.txt
1361 now at: empty 1364 now at: empty
1362 $ hg st 1365 $ hg st
1363 M bye.txt 1366 M bye.txt
1367 ? hello.txt.orig
1364 $ hg diff --config diff.nodates=True 1368 $ hg diff --config diff.nodates=True
1365 diff -r ba252371dbc1 bye.txt 1369 diff -r ba252371dbc1 bye.txt
1366 --- a/bye.txt 1370 --- a/bye.txt
1367 +++ b/bye.txt 1371 +++ b/bye.txt
1368 @@ -1,1 +1,2 @@ 1372 @@ -1,1 +1,2 @@