# HG changeset patch # User Siddharth Agarwal # Date 1447798950 28800 # Node ID a4c26918fb23c4fa8d3cf34ca146251fde572039 # Parent 487cca1bf61ffa2d0827634b662aea451ca6da10 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 diff -r 487cca1bf61f -r a4c26918fb23 mercurial/commands.py --- 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