changeset 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 3185c01c551c
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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