This is an archive of the discontinued Mercurial Phabricator instance.

log: add a config option to limit the number of csets
AbandonedPublic

Authored by pulkit on Aug 22 2018, 8:06 AM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

Things like editor integrations which rely on hg log tends to be very slow on
large repos because calculating the whole log takes time. This patch adds a
config option to limit the number of csets to be displayed using hg log.

Right now, we have an extension which provides a similar config option because
we don't want to patch core mercurial. This will help us in getting rid of that
extension.

.. feature::

A new config option `commands.log.limit` to limit the number of changesets to
be displayed by log command.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Aug 22 2018, 8:06 AM
yuja added a subscriber: yuja.Aug 22 2018, 9:12 AM

diff --git a/hgext/journal.py b/hgext/journal.py

  • a/hgext/journal.py

+++ b/hgext/journal.py
@@ -485,7 +485,7 @@

    displayname = "'%s'" % name
ui.status(_("previous locations of %s:\n") % displayname)
  • limit = logcmdutil.getlimit(opts)

+ limit = logcmdutil.getlimit(ui, opts)

entry = None
ui.pager('journal')
for count, entry in enumerate(repo.journal.filtered(name=name)):

I'm pretty sure this is unrelated to the log limit. Maybe extract
stringutil.parselimit()?

I'm -1 on this: we already have the --limit command line flag, and editor integrations can (and should!) use that flag as needed. Further, this config knob is /going/ to break automations somehow when a user sets it to something silly like 10 unless it reacts to HGPLAIN, but then it wouldn't be useful for editors since they should be setting HGPLAIN.

pulkit abandoned this revision.Aug 23 2018, 9:06 AM