diff 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
line wrap: on
line diff
--- a/tests/test-subrepo.t	Tue Sep 24 15:10:32 2013 -0400
+++ b/tests/test-subrepo.t	Fri Sep 06 00:38:28 2013 +0200
@@ -236,7 +236,9 @@
    .hgsubstate: versions differ -> m
   updating: .hgsubstate 1/1 files (100.00%)
   subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
-    subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
+    subrepo t: both sides changed 
+   subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
+  (M)erge, keep (l)ocal or keep (r)emote? m
   merging subrepo t
     searching for copies back to rev 2
   resolving manifests
@@ -252,6 +254,7 @@
   merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+    subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
@@ -620,6 +623,8 @@
   $ hg up 5
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 4    # try to merge default into br again
+   subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
+  (M)erge, keep (l)ocal or keep (r)emote? m
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ cd ..
@@ -922,9 +927,13 @@
   $ hg -R t id
   e95bcfa18a35+
   $ hg update tip
+   subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
+  (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
    l
+   subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
+  (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for t differ
   use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
    l
@@ -953,6 +962,10 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ..
   $ hg update 10
+   subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
+  (M)erge, keep (l)ocal or keep (r)emote? m
+   subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
+  (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for t differ (in checked out version)
   use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
    l
@@ -976,9 +989,13 @@
   $ hg -R t id
   7af322bc1198+
   $ hg update tip
+   subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
+  (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)?
    l
+   subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
+  (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for t differ
   use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
    l
@@ -1006,6 +1023,8 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ..
   $ hg update 11
+   subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
+  (M)erge, keep (l)ocal or keep (r)emote? m
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n