# HG changeset patch # User Boris Feld # Date 2018-09-27 15:00:00 # Node ID b5e12039e6e0ef9f3758996fe2afb3ebf8915265 # Parent a477679f6323504e9ce4e61de0eaec830bc0e7c1 pullreport: skip or rework some early return We are about to add more logic in this report. Before that, we need it to not quit so early. diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -1620,35 +1620,36 @@ def registersummarycallback(repo, otr, t def reportnewcs(repo, tr): """Report the range of new revisions pulled/unbundled.""" origrepolen = tr.changes.get('origrepolen', len(repo)) - if origrepolen >= len(repo): + unfi = repo.unfiltered() + if origrepolen >= len(unfi): return # Compute the bounds of new visible revisions' range. revs = smartset.spanset(repo, start=origrepolen) - if not revs: - return - minrev, maxrev = repo[revs.min()], repo[revs.max()] + if revs: + minrev, maxrev = repo[revs.min()], repo[revs.max()] - if minrev == maxrev: - revrange = minrev - else: - revrange = '%s:%s' % (minrev, maxrev) - draft = len(repo.revs('%ld and draft()', revs)) - secret = len(repo.revs('%ld and secret()', revs)) - if not (draft or secret): - msg = _('new changesets %s\n') % revrange - elif draft and secret: - msg = _('new changesets %s (%d drafts, %d secrets)\n') - msg %= (revrange, draft, secret) - elif draft: - msg = _('new changesets %s (%d drafts)\n') - msg %= (revrange, draft) - elif secret: - msg = _('new changesets %s (%d secrets)\n') - msg %= (revrange, secret) - else: - raise error.ProgrammingError('entered unreachable condition') - repo.ui.status(msg) + if minrev == maxrev: + revrange = minrev + else: + revrange = '%s:%s' % (minrev, maxrev) + draft = len(repo.revs('%ld and draft()', revs)) + secret = len(repo.revs('%ld and secret()', revs)) + if not (draft or secret): + msg = _('new changesets %s\n') % revrange + elif draft and secret: + msg = _('new changesets %s (%d drafts, %d secrets)\n') + msg %= (revrange, draft, secret) + elif draft: + msg = _('new changesets %s (%d drafts)\n') + msg %= (revrange, draft) + elif secret: + msg = _('new changesets %s (%d secrets)\n') + msg %= (revrange, secret) + else: + errormsg = 'entered unreachable condition' + raise error.ProgrammingError(errormsg) + repo.ui.status(msg) @reportsummary def reportphasechanges(repo, tr):