2488 elif ms._v1v2match(v1records, v2records): |
2488 elif ms._v1v2match(v1records, v2records): |
2489 ui.writenoi18n(b'v1 and v2 states match: using v2\n') |
2489 ui.writenoi18n(b'v1 and v2 states match: using v2\n') |
2490 else: |
2490 else: |
2491 ui.writenoi18n(b'v1 and v2 states mismatch: using v1\n') |
2491 ui.writenoi18n(b'v1 and v2 states mismatch: using v1\n') |
2492 |
2492 |
2493 opts = pycompat.byteskwargs(opts) |
2493 if not opts['template']: |
2494 if not opts[b'template']: |
2494 opts['template'] = ( |
2495 opts[b'template'] = ( |
|
2496 b'{if(commits, "", "no merge state found\n")}' |
2495 b'{if(commits, "", "no merge state found\n")}' |
2497 b'{commits % "{name}{if(label, " ({label})")}: {node}\n"}' |
2496 b'{commits % "{name}{if(label, " ({label})")}: {node}\n"}' |
2498 b'{files % "file: {path} (state \\"{state}\\")\n' |
2497 b'{files % "file: {path} (state \\"{state}\\")\n' |
2499 b'{if(local_path, "' |
2498 b'{if(local_path, "' |
2500 b' local path: {local_path} (hash {local_key}, flags \\"{local_flags}\\")\n' |
2499 b' local path: {local_path} (hash {local_key}, flags \\"{local_flags}\\")\n' |
2510 b'{extras % "extra: {file} ({key} = {value})\n"}' |
2509 b'{extras % "extra: {file} ({key} = {value})\n"}' |
2511 ) |
2510 ) |
2512 |
2511 |
2513 ms = mergestatemod.mergestate.read(repo) |
2512 ms = mergestatemod.mergestate.read(repo) |
2514 |
2513 |
2515 fm = ui.formatter(b'debugmergestate', opts) |
2514 fm = ui.formatter(b'debugmergestate', pycompat.byteskwargs(opts)) |
2516 fm.startitem() |
2515 fm.startitem() |
2517 |
2516 |
2518 fm_commits = fm.nested(b'commits') |
2517 fm_commits = fm.nested(b'commits') |
2519 if ms.active(): |
2518 if ms.active(): |
2520 for name, node, label_index in ( |
2519 for name, node, label_index in ( |