##// END OF EJS Templates
merge: let the user choose to merge, keep local or keep remote subrepo revisions...
Angel Ezquerra -
r19811:5e10d41e default
parent child Browse files
Show More
@@ -202,9 +202,24 b' def submerge(repo, wctx, mctx, actx, ove'
202 wctx.sub(s).get(r, overwrite)
202 wctx.sub(s).get(r, overwrite)
203 sm[s] = r
203 sm[s] = r
204 else:
204 else:
205 debug(s, "both sides changed, merge with", r)
205 debug(s, "both sides changed")
206 wctx.sub(s).merge(r)
206 option = repo.ui.promptchoice(
207 sm[s] = l
207 _(' subrepository %s diverged (local revision: %s, '
208 'remote revision: %s)\n'
209 '(M)erge, keep (l)ocal or keep (r)emote?'
210 '$$ &Merge $$ &Local $$ &Remote')
211 % (s, l[1][:12], r[1][:12]), 0)
212 if option == 0:
213 wctx.sub(s).merge(r)
214 sm[s] = l
215 debug(s, "merge with", r)
216 elif option == 1:
217 sm[s] = l
218 debug(s, "keep local subrepo revision", l)
219 else:
220 wctx.sub(s).get(r, overwrite)
221 sm[s] = r
222 debug(s, "get remote subrepo revision", r)
208 elif ld == a: # remote removed, local unchanged
223 elif ld == a: # remote removed, local unchanged
209 debug(s, "remote removed, remove")
224 debug(s, "remote removed, remove")
210 wctx.sub(s).remove()
225 wctx.sub(s).remove()
@@ -263,6 +263,8 b' qpush'
263 adding sub/a
263 adding sub/a
264 $ hg qpush
264 $ hg qpush
265 applying 1.diff
265 applying 1.diff
266 subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
267 (M)erge, keep (l)ocal or keep (r)emote? m
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 now at: 1.diff
269 now at: 1.diff
268 $ hg status -AS
270 $ hg status -AS
@@ -155,6 +155,8 b' user a pulls, merges, commits'
155 added 1 changesets with 1 changes to 1 files (+1 heads)
155 added 1 changesets with 1 changes to 1 files (+1 heads)
156 (run 'hg heads' to see heads, 'hg merge' to merge)
156 (run 'hg heads' to see heads, 'hg merge' to merge)
157 $ hg merge 2>/dev/null
157 $ hg merge 2>/dev/null
158 subrepository s diverged (local revision: 796959400868, remote revision: aa84837ccfbd)
159 (M)erge, keep (l)ocal or keep (r)emote? m
158 pulling subrepo s from $TESTTMP/gitroot
160 pulling subrepo s from $TESTTMP/gitroot
159 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 (branch merge, don't forget to commit)
162 (branch merge, don't forget to commit)
@@ -462,6 +464,8 b' Sticky subrepositorys, file changes'
462 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
464 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
463 $ cd ..
465 $ cd ..
464 $ hg update 4
466 $ hg update 4
467 subrepository s diverged (local revision: da5f5b1d8ffc, remote revision: aa84837ccfbd)
468 (M)erge, keep (l)ocal or keep (r)emote? m
465 subrepository sources for s differ
469 subrepository sources for s differ
466 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)?
470 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)?
467 l
471 l
@@ -487,6 +491,8 b' Sticky subrepository, revision updates'
487 HEAD is now at aa84837... f
491 HEAD is now at aa84837... f
488 $ cd ..
492 $ cd ..
489 $ hg update 1
493 $ hg update 1
494 subrepository s diverged (local revision: 32a343883b74, remote revision: da5f5b1d8ffc)
495 (M)erge, keep (l)ocal or keep (r)emote? m
490 subrepository sources for s differ (in checked out version)
496 subrepository sources for s differ (in checked out version)
491 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
497 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
492 l
498 l
@@ -508,6 +514,8 b' Sticky subrepository, file changes and r'
508 $ hg id -n
514 $ hg id -n
509 1+
515 1+
510 $ hg update 7
516 $ hg update 7
517 subrepository s diverged (local revision: 32a343883b74, remote revision: 32a343883b74)
518 (M)erge, keep (l)ocal or keep (r)emote? m
511 subrepository sources for s differ
519 subrepository sources for s differ
512 use (l)ocal source (32a3438) or (r)emote source (32a3438)?
520 use (l)ocal source (32a3438) or (r)emote source (32a3438)?
513 l
521 l
@@ -319,6 +319,8 b' Sticky subrepositorys, file changes'
319 2M
319 2M
320 $ cd ..
320 $ cd ..
321 $ hg update tip
321 $ hg update tip
322 subrepository s diverged (local revision: 2, remote revision: 3)
323 (M)erge, keep (l)ocal or keep (r)emote? m
322 subrepository sources for s differ
324 subrepository sources for s differ
323 use (l)ocal source (2) or (r)emote source (3)?
325 use (l)ocal source (2) or (r)emote source (3)?
324 l
326 l
@@ -349,6 +351,8 b' Sticky subrepository, revision updates'
349 $ svn update -qr 1
351 $ svn update -qr 1
350 $ cd ..
352 $ cd ..
351 $ hg update 1
353 $ hg update 1
354 subrepository s diverged (local revision: 3, remote revision: 2)
355 (M)erge, keep (l)ocal or keep (r)emote? m
352 subrepository sources for s differ (in checked out version)
356 subrepository sources for s differ (in checked out version)
353 use (l)ocal source (1) or (r)emote source (2)?
357 use (l)ocal source (1) or (r)emote source (2)?
354 l
358 l
@@ -371,6 +375,8 b' Sticky subrepository, file changes and r'
371 $ hg id -n
375 $ hg id -n
372 1+
376 1+
373 $ hg update tip
377 $ hg update tip
378 subrepository s diverged (local revision: 3, remote revision: 3)
379 (M)erge, keep (l)ocal or keep (r)emote? m
374 subrepository sources for s differ
380 subrepository sources for s differ
375 use (l)ocal source (1) or (r)emote source (3)?
381 use (l)ocal source (1) or (r)emote source (3)?
376 l
382 l
@@ -404,6 +410,8 b' Test subrepo already at intended revisio'
404 $ svn update -qr 2
410 $ svn update -qr 2
405 $ cd ..
411 $ cd ..
406 $ hg update 1
412 $ hg update 1
413 subrepository s diverged (local revision: 3, remote revision: 2)
414 (M)erge, keep (l)ocal or keep (r)emote? m
407 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
408 $ hg id -n
416 $ hg id -n
409 1+
417 1+
@@ -236,7 +236,9 b' merge tests'
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
@@ -252,6 +254,7 b' merge tests'
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
@@ -620,6 +623,8 b" shouldn't need merging"
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 ..
@@ -922,9 +927,13 b' Sticky subrepositorys, file changes'
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
@@ -953,6 +962,10 b' Sticky subrepository, revision updates'
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
@@ -976,9 +989,13 b' Sticky subrepository, file changes and r'
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
@@ -1006,6 +1023,8 b' Test subrepo already at intended revisio'
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
General Comments 0
You need to be logged in to leave comments. Login now