mercurial/scmutil.py
changeset 39480 89630d0b3e23
parent 39360 570fca90d556
child 39694 6192980553b4
--- a/mercurial/scmutil.py	Fri Sep 07 23:54:42 2018 -0400
+++ b/mercurial/scmutil.py	Thu Aug 30 01:53:21 2018 +0200
@@ -1634,7 +1634,22 @@
                 revrange = minrev
             else:
                 revrange = '%s:%s' % (minrev, maxrev)
-            repo.ui.status(_('new changesets %s\n') % revrange)
+            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)
 
         @reportsummary
         def reportphasechanges(repo, tr):