Show More
@@ -503,13 +503,6 b' def simplemerge(ui, localctx, basectx, o' | |||||
503 | # repository usually sees) might be more useful. |
|
503 | # repository usually sees) might be more useful. | |
504 | return _verifytext(ctx.decodeddata(), ctx.path(), ui, opts) |
|
504 | return _verifytext(ctx.decodeddata(), ctx.path(), ui, opts) | |
505 |
|
505 | |||
506 | mode = opts.get('mode', b'merge') |
|
|||
507 | name_a, name_b, name_base = None, None, None |
|
|||
508 | if mode != b'union': |
|
|||
509 | name_a, name_b, name_base = _picklabels( |
|
|||
510 | [localctx.path(), otherctx.path(), None], opts.get('label', []) |
|
|||
511 | ) |
|
|||
512 |
|
||||
513 | try: |
|
506 | try: | |
514 | localtext = readctx(localctx) |
|
507 | localtext = readctx(localctx) | |
515 | basetext = readctx(basectx) |
|
508 | basetext = readctx(basectx) | |
@@ -519,26 +512,31 b' def simplemerge(ui, localctx, basectx, o' | |||||
519 |
|
512 | |||
520 | m3 = Merge3Text(basetext, localtext, othertext) |
|
513 | m3 = Merge3Text(basetext, localtext, othertext) | |
521 | conflicts = False |
|
514 | conflicts = False | |
|
515 | mode = opts.get('mode', b'merge') | |||
522 | if mode == b'union': |
|
516 | if mode == b'union': | |
523 | lines = _resolve(m3, (1, 2)) |
|
517 | lines = _resolve(m3, (1, 2)) | |
524 | elif mode == b'local': |
|
518 | elif mode == b'local': | |
525 | lines = _resolve(m3, (1,)) |
|
519 | lines = _resolve(m3, (1,)) | |
526 | elif mode == b'other': |
|
520 | elif mode == b'other': | |
527 | lines = _resolve(m3, (2,)) |
|
521 | lines = _resolve(m3, (2,)) | |
528 | elif mode == b'mergediff': |
|
|||
529 | lines, conflicts = _mergediff(m3, name_a, name_b, name_base) |
|
|||
530 | else: |
|
522 | else: | |
531 | extrakwargs = { |
|
523 | name_a, name_b, name_base = _picklabels( | |
532 | 'minimize': True, |
|
524 | [localctx.path(), otherctx.path(), None], opts.get('label', []) | |
533 | } |
|
|||
534 | if name_base is not None: |
|
|||
535 | extrakwargs['base_marker'] = b'|||||||' |
|
|||
536 | extrakwargs['name_base'] = name_base |
|
|||
537 | extrakwargs['minimize'] = False |
|
|||
538 | lines = list( |
|
|||
539 | m3.merge_lines(name_a=name_a, name_b=name_b, **extrakwargs) |
|
|||
540 | ) |
|
525 | ) | |
541 | conflicts = m3.conflicts |
|
526 | if mode == b'mergediff': | |
|
527 | lines, conflicts = _mergediff(m3, name_a, name_b, name_base) | |||
|
528 | else: | |||
|
529 | extrakwargs = { | |||
|
530 | 'minimize': True, | |||
|
531 | } | |||
|
532 | if name_base is not None: | |||
|
533 | extrakwargs['base_marker'] = b'|||||||' | |||
|
534 | extrakwargs['name_base'] = name_base | |||
|
535 | extrakwargs['minimize'] = False | |||
|
536 | lines = list( | |||
|
537 | m3.merge_lines(name_a=name_a, name_b=name_b, **extrakwargs) | |||
|
538 | ) | |||
|
539 | conflicts = m3.conflicts | |||
542 |
|
540 | |||
543 | mergedtext = b''.join(lines) |
|
541 | mergedtext = b''.join(lines) | |
544 | if opts.get('print'): |
|
542 | if opts.get('print'): |
General Comments 0
You need to be logged in to leave comments.
Login now