Mercurial > hg
annotate tests/test-pull-update.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 | 610873cf064a |
children | f2719b387380 |
rev | line source |
---|---|
12279 | 1 $ hg init t |
2 $ cd t | |
3 $ echo 1 > foo | |
4 $ hg ci -Am m | |
5 adding foo | |
6 | |
7 $ cd .. | |
8 $ hg clone t tt | |
9 updating to branch default | |
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
11 $ cd tt | |
12 $ echo 1.1 > foo | |
13 $ hg ci -Am m | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
14 |
12279 | 15 $ cd ../t |
16 $ echo 1.2 > foo | |
17 $ hg ci -Am m | |
18 | |
19 Should not update: | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
20 |
12279 | 21 $ hg pull -u ../tt |
22 pulling from ../tt | |
23 searching for changes | |
24 adding changesets | |
25 adding manifests | |
26 adding file changes | |
27 added 1 changesets with 1 changes to 1 files (+1 heads) | |
14485
610873cf064a
Make pull -u behave like pull && update
Brendan Cully <brendan@kublai.com>
parents:
12279
diff
changeset
|
28 not updating: crosses branches (merge branches or update --check to force update) |
12279 | 29 |
30 $ cd ../tt | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
31 |
12279 | 32 Should not update: |
33 | |
34 $ hg pull -u ../t | |
35 pulling from ../t | |
36 searching for changes | |
37 adding changesets | |
38 adding manifests | |
39 adding file changes | |
40 added 1 changesets with 1 changes to 1 files (+1 heads) | |
14485
610873cf064a
Make pull -u behave like pull && update
Brendan Cully <brendan@kublai.com>
parents:
12279
diff
changeset
|
41 not updating: crosses branches (merge branches or update --check to force update) |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
42 |
12279 | 43 $ HGMERGE=true hg merge |
44 merging foo | |
45 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
46 (branch merge, don't forget to commit) | |
47 $ hg ci -mm | |
48 | |
49 $ cd ../t | |
50 | |
51 Should work: | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
52 |
12279 | 53 $ hg pull -u ../tt |
54 pulling from ../tt | |
55 searching for changes | |
56 adding changesets | |
57 adding manifests | |
58 adding file changes | |
59 added 1 changesets with 1 changes to 1 files (-1 heads) | |
60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
61 |