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
--- a/mercurial/commands.py Wed Nov 11 13:28:00 2015 -0800
+++ b/mercurial/commands.py Tue Nov 17 14:22:30 2015 -0800
@@ -2556,6 +2556,9 @@
ui.write(('unrecognized entry: %s\t%s\n')
% (rtype, record.replace('\0', '\t')))
+ # Avoid mergestate.read() since it may raise an exception for unsupported
+ # merge state records. We shouldn't be doing this, but this is OK since this
+ # command is pretty low-level.
ms = mergemod.mergestate(repo)
# sort so that reasonable information is on top