Mercurial > hg
comparison tests/test-subrepo.t @ 19811:5e10d41e7b9c
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1378420708 -7200
# Fri Sep 06 00:38:28 2013 +0200
# Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d
# Parent 50d721553198cea51c30f53b76d41dc919280097
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
author | Angel Ezquerra <angel.ezquerra@gmail.com> |
---|---|
date | Fri, 06 Sep 2013 00:38:28 +0200 |
parents | 6cf8e3b4e074 |
children | bfc6ed892349 |
comparison
equal
deleted
inserted
replaced
19810:c80feeb715d1 | 19811:5e10d41e7b9c |
---|---|
234 branchmerge: True, force: False, partial: False | 234 branchmerge: True, force: False, partial: False |
235 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf | 235 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf |
236 .hgsubstate: versions differ -> m | 236 .hgsubstate: versions differ -> m |
237 updating: .hgsubstate 1/1 files (100.00%) | 237 updating: .hgsubstate 1/1 files (100.00%) |
238 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4 | 238 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4 |
239 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg | 239 subrepo t: both sides changed |
240 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198) | |
241 (M)erge, keep (l)ocal or keep (r)emote? m | |
240 merging subrepo t | 242 merging subrepo t |
241 searching for copies back to rev 2 | 243 searching for copies back to rev 2 |
242 resolving manifests | 244 resolving manifests |
243 branchmerge: True, force: False, partial: False | 245 branchmerge: True, force: False, partial: False |
244 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198 | 246 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198 |
250 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a | 252 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a |
251 warning: conflicts during merge. | 253 warning: conflicts during merge. |
252 merging t incomplete! (edit conflicts, then use 'hg resolve --mark') | 254 merging t incomplete! (edit conflicts, then use 'hg resolve --mark') |
253 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | 255 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
254 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | 256 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
257 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg | |
255 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 258 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
256 (branch merge, don't forget to commit) | 259 (branch merge, don't forget to commit) |
257 | 260 |
258 should conflict | 261 should conflict |
259 | 262 |
618 adding e | 621 adding e |
619 | 622 |
620 $ hg up 5 | 623 $ hg up 5 |
621 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
622 $ hg merge 4 # try to merge default into br again | 625 $ hg merge 4 # try to merge default into br again |
626 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88) | |
627 (M)erge, keep (l)ocal or keep (r)emote? m | |
623 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 628 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
624 (branch merge, don't forget to commit) | 629 (branch merge, don't forget to commit) |
625 $ cd .. | 630 $ cd .. |
626 | 631 |
627 test subrepo delete from .hgsubstate | 632 test subrepo delete from .hgsubstate |
920 $ hg -R s id | 925 $ hg -R s id |
921 fc627a69481f+ | 926 fc627a69481f+ |
922 $ hg -R t id | 927 $ hg -R t id |
923 e95bcfa18a35+ | 928 e95bcfa18a35+ |
924 $ hg update tip | 929 $ hg update tip |
930 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9) | |
931 (M)erge, keep (l)ocal or keep (r)emote? m | |
925 subrepository sources for s differ | 932 subrepository sources for s differ |
926 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? | 933 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? |
927 l | 934 l |
935 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a) | |
936 (M)erge, keep (l)ocal or keep (r)emote? m | |
928 subrepository sources for t differ | 937 subrepository sources for t differ |
929 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? | 938 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? |
930 l | 939 l |
931 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 940 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
932 $ hg id | 941 $ hg id |
951 $ cd ../t | 960 $ cd ../t |
952 $ hg update -r 2 | 961 $ hg update -r 2 |
953 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 962 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
954 $ cd .. | 963 $ cd .. |
955 $ hg update 10 | 964 $ hg update 10 |
965 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) | |
966 (M)erge, keep (l)ocal or keep (r)emote? m | |
967 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c) | |
968 (M)erge, keep (l)ocal or keep (r)emote? m | |
956 subrepository sources for t differ (in checked out version) | 969 subrepository sources for t differ (in checked out version) |
957 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? | 970 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? |
958 l | 971 l |
959 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 972 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
960 $ hg id | 973 $ hg id |
974 $ hg -R s id | 987 $ hg -R s id |
975 02dcf1d70411+ | 988 02dcf1d70411+ |
976 $ hg -R t id | 989 $ hg -R t id |
977 7af322bc1198+ | 990 7af322bc1198+ |
978 $ hg update tip | 991 $ hg update tip |
992 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9) | |
993 (M)erge, keep (l)ocal or keep (r)emote? m | |
979 subrepository sources for s differ | 994 subrepository sources for s differ |
980 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? | 995 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? |
981 l | 996 l |
997 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a) | |
998 (M)erge, keep (l)ocal or keep (r)emote? m | |
982 subrepository sources for t differ | 999 subrepository sources for t differ |
983 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? | 1000 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? |
984 l | 1001 l |
985 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1002 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
986 $ hg id | 1003 $ hg id |
1004 $ cd s | 1021 $ cd s |
1005 $ hg update fc627a69481f | 1022 $ hg update fc627a69481f |
1006 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1007 $ cd .. | 1024 $ cd .. |
1008 $ hg update 11 | 1025 $ hg update 11 |
1026 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) | |
1027 (M)erge, keep (l)ocal or keep (r)emote? m | |
1009 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1028 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1010 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1029 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1011 $ hg id -n | 1030 $ hg id -n |
1012 11+ | 1031 11+ |
1013 $ hg -R s id | 1032 $ hg -R s id |