Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 27004:a4c26918fb23
debugmergestate: explain why we create mergestate objects directly
We would normally use the read() constructor, but in this case it's fine
because
- we implement our own reading layer, so the extra parsing done by
read() is unnecessary
- read() can raise an exception for unsupported merge state records,
but here we'd like to handle that separately
- debugmergestate needs to be privy to mergestate internals anyway
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 17 Nov 2015 14:22:30 -0800 |
parents | 487cca1bf61f |
children | f4fec0940278 |
comparison
equal
deleted
inserted
replaced
27003:487cca1bf61f | 27004:a4c26918fb23 |
---|---|
2554 ui.write((' other path: %s (node %s)\n') % (ofile, onode)) | 2554 ui.write((' other path: %s (node %s)\n') % (ofile, onode)) |
2555 else: | 2555 else: |
2556 ui.write(('unrecognized entry: %s\t%s\n') | 2556 ui.write(('unrecognized entry: %s\t%s\n') |
2557 % (rtype, record.replace('\0', '\t'))) | 2557 % (rtype, record.replace('\0', '\t'))) |
2558 | 2558 |
2559 # Avoid mergestate.read() since it may raise an exception for unsupported | |
2560 # merge state records. We shouldn't be doing this, but this is OK since this | |
2561 # command is pretty low-level. | |
2559 ms = mergemod.mergestate(repo) | 2562 ms = mergemod.mergestate(repo) |
2560 | 2563 |
2561 # sort so that reasonable information is on top | 2564 # sort so that reasonable information is on top |
2562 v1records = ms._readrecordsv1() | 2565 v1records = ms._readrecordsv1() |
2563 v2records = ms._readrecordsv2() | 2566 v2records = ms._readrecordsv2() |