Mercurial > hg
changeset 26994:676c3838d217
commands.summary: switch to mergestate.read()
See previous patch for why we're doing this.
We do this with a bit of care -- it would be bad form for 'hg summary' to abort
completely if we encounter an unsupported merge record. Instead just warn about
that and continue with the rest of the summary.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 17 Nov 2015 14:20:55 -0800 |
parents | d240ae897ba6 |
children | d5a6be56970b |
files | mercurial/commands.py |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Tue Nov 17 13:56:46 2015 -0800 +++ b/mercurial/commands.py Tue Nov 17 14:20:55 2015 -0800 @@ -6208,8 +6208,15 @@ if d in status.added: status.added.remove(d) - ms = mergemod.mergestate(repo) - unresolved = [f for f in ms if ms[f] == 'u'] + try: + ms = mergemod.mergestate.read(repo) + except error.UnsupportedMergeRecords as e: + s = ' '.join(e.recordtypes) + ui.warn( + _('warning: merge state has unsupported record types: %s\n') % s) + unresolved = 0 + else: + unresolved = [f for f in ms if ms[f] == 'u'] subs = [s for s in ctx.substate if ctx.sub(s).dirty()]