Submitter | Siddharth Agarwal |
---|---|
Date | Nov. 18, 2015, 5:48 a.m. |
Message ID | <1c3f6bcf4b99e8f368b5.1447825713@dev666.prn1.facebook.com> |
Download | mbox | patch |
Permalink | /patch/11463/ |
State | Accepted |
Headers | show |
Comments
Do we want to include a URL pointer for Merge state record types? On Nov 18, 2015 12:51 AM, "Siddharth Agarwal" <sid0@fb.com> wrote: > # HG changeset patch > # User Siddharth Agarwal <sid0@fb.com> > # Date 1447798855 28800 > # Tue Nov 17 14:20:55 2015 -0800 > # Node ID 1c3f6bcf4b99e8f368b54518287eae3e0ea0fb44 > # Parent 5f1d5c34efb07bc255677ede7a9568a349f7481c > 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. > > diff --git a/mercurial/commands.py b/mercurial/commands.py > --- a/mercurial/commands.py > +++ b/mercurial/commands.py > @@ -6208,8 +6208,15 @@ def summary(ui, repo, **opts): > 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()] > > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@selenic.com > https://selenic.com/mailman/listinfo/mercurial-devel >
Patch
diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6208,8 +6208,15 @@ def summary(ui, repo, **opts): 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()]