##// END OF EJS Templates
merge: move cd/dc prompts after largefiles prompts...
Martin von Zweigbergk -
r23541:495bc1b6 default
parent child Browse files
Show More
@@ -440,9 +440,9 b' def overridecalculateupdates(origfn, rep'
440
440
441 for lfile in lfiles:
441 for lfile in lfiles:
442 standin = lfutil.standin(lfile)
442 standin = lfutil.standin(lfile)
443 lm = actionbyfile.get(lfile, (None, None, None))[0]
443 (lm, largs, lmsg) = actionbyfile.get(lfile, (None, None, None))
444 sm = actionbyfile.get(standin, (None, None, None))[0]
444 (sm, sargs, smsg) = actionbyfile.get(standin, (None, None, None))
445 if sm == 'g' and lm != 'r':
445 if sm in ('g', 'dc') and lm != 'r':
446 # Case 1: normal file in the working copy, largefile in
446 # Case 1: normal file in the working copy, largefile in
447 # the second parent
447 # the second parent
448 usermsg = _('remote turned local normal file %s into a largefile\n'
448 usermsg = _('remote turned local normal file %s into a largefile\n'
@@ -450,14 +450,16 b' def overridecalculateupdates(origfn, rep'
450 '$$ &Largefile $$ &Normal file') % lfile
450 '$$ &Largefile $$ &Normal file') % lfile
451 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
451 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
452 actionbyfile[lfile] = ('r', None, 'replaced by standin')
452 actionbyfile[lfile] = ('r', None, 'replaced by standin')
453 actionbyfile[standin] = ('g', sargs, 'replaces standin')
453 else: # keep local normal file
454 else: # keep local normal file
455 actionbyfile[lfile] = ('k', None, 'replaces standin')
454 if branchmerge:
456 if branchmerge:
455 actionbyfile[standin] = ('k', None,
457 actionbyfile[standin] = ('k', None,
456 'replaced by non-standin')
458 'replaced by non-standin')
457 else:
459 else:
458 actionbyfile[standin] = ('r', None,
460 actionbyfile[standin] = ('r', None,
459 'replaced by non-standin')
461 'replaced by non-standin')
460 elif lm == 'g' and sm != 'r':
462 elif lm in ('g', 'dc') and sm != 'r':
461 # Case 2: largefile in the working copy, normal file in
463 # Case 2: largefile in the working copy, normal file in
462 # the second parent
464 # the second parent
463 usermsg = _('remote turned local largefile %s into a normal file\n'
465 usermsg = _('remote turned local largefile %s into a normal file\n'
@@ -467,6 +469,7 b' def overridecalculateupdates(origfn, rep'
467 if branchmerge:
469 if branchmerge:
468 # largefile can be restored from standin safely
470 # largefile can be restored from standin safely
469 actionbyfile[lfile] = ('k', None, 'replaced by standin')
471 actionbyfile[lfile] = ('k', None, 'replaced by standin')
472 actionbyfile[standin] = ('k', None, 'replaces standin')
470 else:
473 else:
471 # "lfile" should be marked as "removed" without
474 # "lfile" should be marked as "removed" without
472 # removal of itself
475 # removal of itself
@@ -476,6 +479,7 b' def overridecalculateupdates(origfn, rep'
476 # linear-merge should treat this largefile as 're-added'
479 # linear-merge should treat this largefile as 're-added'
477 actionbyfile[standin] = ('a', None, 'keep standin')
480 actionbyfile[standin] = ('a', None, 'keep standin')
478 else: # pick remote normal file
481 else: # pick remote normal file
482 actionbyfile[lfile] = ('g', largs, 'replaces standin')
479 actionbyfile[standin] = ('r', None, 'replaced by non-standin')
483 actionbyfile[standin] = ('r', None, 'replaced by non-standin')
480
484
481 # Convert back to dictionary-of-lists format
485 # Convert back to dictionary-of-lists format
@@ -640,26 +640,6 b' def calculateupdates(repo, wctx, mctx, a'
640
640
641 _resolvetrivial(repo, wctx, mctx, ancestors[0], actions)
641 _resolvetrivial(repo, wctx, mctx, ancestors[0], actions)
642
642
643 # Prompt and create actions. TODO: Move this towards resolve phase.
644 for f, args, msg in sorted(actions['cd']):
645 if repo.ui.promptchoice(
646 _("local changed %s which remote deleted\n"
647 "use (c)hanged version or (d)elete?"
648 "$$ &Changed $$ &Delete") % f, 0):
649 actions['r'].append((f, None, "prompt delete"))
650 else:
651 actions['a'].append((f, None, "prompt keep"))
652 del actions['cd'][:]
653
654 for f, args, msg in sorted(actions['dc']):
655 flags, = args
656 if repo.ui.promptchoice(
657 _("remote changed %s which local deleted\n"
658 "use (c)hanged version or leave (d)eleted?"
659 "$$ &Changed $$ &Deleted") % f, 0) == 0:
660 actions['g'].append((f, (flags,), "prompt recreating"))
661 del actions['dc'][:]
662
663 if wctx.rev() is None:
643 if wctx.rev() is None:
664 ractions, factions = _forgetremoved(wctx, mctx, branchmerge)
644 ractions, factions = _forgetremoved(wctx, mctx, branchmerge)
665 actions['r'].extend(ractions)
645 actions['r'].extend(ractions)
@@ -1111,6 +1091,26 b' def update(repo, node, branchmerge, forc'
1111 repo, wc, p2, pas, branchmerge, force, partial, mergeancestor,
1091 repo, wc, p2, pas, branchmerge, force, partial, mergeancestor,
1112 followcopies)
1092 followcopies)
1113
1093
1094 # Prompt and create actions. TODO: Move this towards resolve phase.
1095 for f, args, msg in sorted(actions['cd']):
1096 if repo.ui.promptchoice(
1097 _("local changed %s which remote deleted\n"
1098 "use (c)hanged version or (d)elete?"
1099 "$$ &Changed $$ &Delete") % f, 0):
1100 actions['r'].append((f, None, "prompt delete"))
1101 else:
1102 actions['a'].append((f, None, "prompt keep"))
1103 del actions['cd'][:]
1104
1105 for f, args, msg in sorted(actions['dc']):
1106 flags, = args
1107 if repo.ui.promptchoice(
1108 _("remote changed %s which local deleted\n"
1109 "use (c)hanged version or leave (d)eleted?"
1110 "$$ &Changed $$ &Deleted") % f, 0) == 0:
1111 actions['g'].append((f, (flags,), "prompt recreating"))
1112 del actions['dc'][:]
1113
1114 ### apply phase
1114 ### apply phase
1115 if not branchmerge: # just jump to the new rev
1115 if not branchmerge: # just jump to the new rev
1116 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
1116 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
@@ -283,8 +283,6 b' Ancestor: normal Parent: normal2 Paren'
283
283
284 $ hg up -Cqr normal2
284 $ hg up -Cqr normal2
285 $ hg merge -r large
285 $ hg merge -r large
286 local changed f which remote deleted
287 use (c)hanged version or (d)elete? c
288 remote turned local normal file f into a largefile
286 remote turned local normal file f into a largefile
289 use (l)argefile or keep (n)ormal file? l
287 use (l)argefile or keep (n)ormal file? l
290 getting changed largefiles
288 getting changed largefiles
@@ -295,9 +293,7 b' Ancestor: normal Parent: normal2 Paren'
295 large
293 large
296
294
297 $ hg up -Cqr normal2
295 $ hg up -Cqr normal2
298 $ ( echo c; echo n ) | hg merge -r large --config ui.interactive=Yes
296 $ echo n | hg merge -r large --config ui.interactive=Yes
299 local changed f which remote deleted
300 use (c)hanged version or (d)elete? c
301 remote turned local normal file f into a largefile
297 remote turned local normal file f into a largefile
302 use (l)argefile or keep (n)ormal file? n
298 use (l)argefile or keep (n)ormal file? n
303 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
299 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -305,23 +301,10 b' Ancestor: normal Parent: normal2 Paren'
305 $ cat f
301 $ cat f
306 normal2
302 normal2
307
303
308 $ hg up -Cqr normal2
309 $ echo d | hg merge -r large --config ui.interactive=Yes
310 local changed f which remote deleted
311 use (c)hanged version or (d)elete? d
312 getting changed largefiles
313 1 largefiles updated, 0 removed
314 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
315 (branch merge, don't forget to commit)
316 $ cat f
317 large
318
319 swap
304 swap
320
305
321 $ hg up -Cqr large
306 $ hg up -Cqr large
322 $ hg merge -r normal2
307 $ hg merge -r normal2
323 remote changed f which local deleted
324 use (c)hanged version or leave (d)eleted? c
325 remote turned local largefile f into a normal file
308 remote turned local largefile f into a normal file
326 keep (l)argefile or use (n)ormal file? l
309 keep (l)argefile or use (n)ormal file? l
327 getting changed largefiles
310 getting changed largefiles
@@ -332,9 +315,7 b' swap'
332 large
315 large
333
316
334 $ hg up -Cqr large
317 $ hg up -Cqr large
335 $ ( echo c; echo n ) | hg merge -r normal2 --config ui.interactive=Yes
318 $ echo n | hg merge -r normal2 --config ui.interactive=Yes
336 remote changed f which local deleted
337 use (c)hanged version or leave (d)eleted? c
338 remote turned local largefile f into a normal file
319 remote turned local largefile f into a normal file
339 keep (l)argefile or use (n)ormal file? n
320 keep (l)argefile or use (n)ormal file? n
340 getting changed largefiles
321 getting changed largefiles
@@ -344,17 +325,6 b' swap'
344 $ cat f
325 $ cat f
345 normal2
326 normal2
346
327
347 $ hg up -Cqr large
348 $ echo d | hg merge -r normal2 --config ui.interactive=Yes
349 remote changed f which local deleted
350 use (c)hanged version or leave (d)eleted? d
351 getting changed largefiles
352 0 largefiles updated, 0 removed
353 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
354 (branch merge, don't forget to commit)
355 $ cat f
356 large
357
358 Ancestor: large Parent: large-id Parent: normal result: normal
328 Ancestor: large Parent: large-id Parent: normal result: normal
359
329
360 $ hg up -Cqr large-id
330 $ hg up -Cqr large-id
@@ -400,8 +370,6 b' Ancestor: large Parent: large2 Paren'
400
370
401 $ hg up -Cqr large2
371 $ hg up -Cqr large2
402 $ hg merge -r normal
372 $ hg merge -r normal
403 local changed .hglf/f which remote deleted
404 use (c)hanged version or (d)elete? c
405 remote turned local largefile f into a normal file
373 remote turned local largefile f into a normal file
406 keep (l)argefile or use (n)ormal file? l
374 keep (l)argefile or use (n)ormal file? l
407 getting changed largefiles
375 getting changed largefiles
@@ -412,9 +380,9 b' Ancestor: large Parent: large2 Paren'
412 large2
380 large2
413
381
414 $ hg up -Cqr large2
382 $ hg up -Cqr large2
415 $ echo d | hg merge -r normal --config ui.interactive=Yes
383 $ echo n | hg merge -r normal --config ui.interactive=Yes
416 local changed .hglf/f which remote deleted
384 remote turned local largefile f into a normal file
417 use (c)hanged version or (d)elete? d
385 keep (l)argefile or use (n)ormal file? n
418 getting changed largefiles
386 getting changed largefiles
419 0 largefiles updated, 0 removed
387 0 largefiles updated, 0 removed
420 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
388 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -426,8 +394,6 b' swap'
426
394
427 $ hg up -Cqr normal
395 $ hg up -Cqr normal
428 $ hg merge -r large2
396 $ hg merge -r large2
429 remote changed .hglf/f which local deleted
430 use (c)hanged version or leave (d)eleted? c
431 remote turned local normal file f into a largefile
397 remote turned local normal file f into a largefile
432 use (l)argefile or keep (n)ormal file? l
398 use (l)argefile or keep (n)ormal file? l
433 getting changed largefiles
399 getting changed largefiles
@@ -438,9 +404,9 b' swap'
438 large2
404 large2
439
405
440 $ hg up -Cqr normal
406 $ hg up -Cqr normal
441 $ echo d | hg merge -r large2 --config ui.interactive=Yes
407 $ echo n | hg merge -r large2 --config ui.interactive=Yes
442 remote changed .hglf/f which local deleted
408 remote turned local normal file f into a largefile
443 use (c)hanged version or leave (d)eleted? d
409 use (l)argefile or keep (n)ormal file? n
444 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
410 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 (branch merge, don't forget to commit)
411 (branch merge, don't forget to commit)
446 $ cat f
412 $ cat f
@@ -320,8 +320,6 b' Test a linear merge to a revision contai'
320 $ hg update -q -C 2
320 $ hg update -q -C 2
321 $ echo 'modified large2 for linear merge' > large2
321 $ echo 'modified large2 for linear merge' > large2
322 $ hg update -q 5
322 $ hg update -q 5
323 local changed .hglf/large2 which remote deleted
324 use (c)hanged version or (d)elete? c
325 remote turned local largefile large2 into a normal file
323 remote turned local largefile large2 into a normal file
326 keep (l)argefile or use (n)ormal file? l
324 keep (l)argefile or use (n)ormal file? l
327 $ hg debugdirstate --nodates | grep large2
325 $ hg debugdirstate --nodates | grep large2
@@ -368,8 +366,6 b' Test that the internal linear merging wo'
368 adding manifests
366 adding manifests
369 adding file changes
367 adding file changes
370 added 3 changesets with 5 changes to 5 files
368 added 3 changesets with 5 changes to 5 files
371 local changed .hglf/large2 which remote deleted
372 use (c)hanged version or (d)elete? c
373 remote turned local largefile large2 into a normal file
369 remote turned local largefile large2 into a normal file
374 keep (l)argefile or use (n)ormal file? l
370 keep (l)argefile or use (n)ormal file? l
375 largefile large1 has a merge conflict
371 largefile large1 has a merge conflict
@@ -403,8 +399,6 b' Test that the internal linear merging wo'
403 adding manifests
399 adding manifests
404 adding file changes
400 adding file changes
405 added 3 changesets with 5 changes to 5 files
401 added 3 changesets with 5 changes to 5 files
406 local changed .hglf/large2 which remote deleted
407 use (c)hanged version or (d)elete? c
408 remote turned local largefile large2 into a normal file
402 remote turned local largefile large2 into a normal file
409 keep (l)argefile or use (n)ormal file? l
403 keep (l)argefile or use (n)ormal file? l
410 largefile large1 has a merge conflict
404 largefile large1 has a merge conflict
@@ -451,7 +445,6 b' Test that the internal linear merging wo'
451 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
445 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
452 > m
446 > m
453 > r
447 > r
454 > c
455 > l
448 > l
456 > l
449 > l
457 > EOF
450 > EOF
@@ -459,8 +452,6 b' Test that the internal linear merging wo'
459 (M)erge, keep (l)ocal or keep (r)emote? m
452 (M)erge, keep (l)ocal or keep (r)emote? m
460 subrepository sources for sub differ (in checked out version)
453 subrepository sources for sub differ (in checked out version)
461 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
454 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
462 local changed .hglf/large2 which remote deleted
463 use (c)hanged version or (d)elete? c
464 remote turned local largefile large2 into a normal file
455 remote turned local largefile large2 into a normal file
465 keep (l)argefile or use (n)ormal file? l
456 keep (l)argefile or use (n)ormal file? l
466 largefile large1 has a merge conflict
457 largefile large1 has a merge conflict
General Comments 0
You need to be logged in to leave comments. Login now