# HG changeset patch # User Benoit Boissinot # Date 1140505906 -3600 # Node ID 7eb1934f83fb4b995912c5dc4db9c8d1ede96197 # Parent 13f8e068d13c78386b077f28e279b2e6ea43d2aa# Parent 47f4fbee32c55a6e8b9febd5a4a3ba69c131f3fd merge with crew diff -r 13f8e068d13c -r 7eb1934f83fb doc/hg.1.txt --- a/doc/hg.1.txt Tue Feb 21 00:45:02 2006 +0100 +++ b/doc/hg.1.txt Tue Feb 21 08:11:46 2006 +0100 @@ -376,6 +376,11 @@ options: -I, --include include names matching the given patterns -X, --exclude exclude names matching the given patterns + -b, --branch show branches + -k, --keyword search for keywords + -l, --limit print no more than this many changes + -M, --no-merges do not show merges + -m, --only-merges only show merges -r, --rev show the specified revision or range -p, --patch show patch diff -r 13f8e068d13c -r 7eb1934f83fb mercurial/commands.py --- a/mercurial/commands.py Tue Feb 21 00:45:02 2006 +0100 +++ b/mercurial/commands.py Tue Feb 21 08:11:46 2006 +0100 @@ -1611,7 +1611,19 @@ self.write(*args) def __getattr__(self, key): return getattr(self.ui, key) + changeiter, getchange, matchfn = walkchangerevs(ui, repo, pats, opts) + + if opts['limit']: + try: + limit = int(opts['limit']) + except ValueError: + raise util.Abort(_('limit must be a positive integer')) + if limit <= 0: raise util.Abort(_('limit must be positive')) + else: + limit = sys.maxint + count = 0 + for st, rev, fns in changeiter: if st == 'window': du = dui(ui) @@ -1647,6 +1659,8 @@ dodiff(du, du, repo, prev, changenode, match=matchfn) du.write("\n\n") elif st == 'iter': + if count == limit: break + count += 1 for args in du.hunk[rev]: ui.write(*args) @@ -2462,6 +2476,7 @@ ('X', 'exclude', [], _('exclude names matching the given patterns')), ('b', 'branch', None, _('show branches')), ('k', 'keyword', [], _('search for a keyword')), + ('l', 'limit', '', _('limit number of changes displayed')), ('r', 'rev', [], _('show the specified revision or range')), ('M', 'no-merges', None, _('do not show merges')), ('m', 'only-merges', None, _('show only merges')),