Mercurial > hg
changeset 1761:7eb1934f83fb
merge with crew
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 21 Feb 2006 08:11:46 +0100 |
parents | 13f8e068d13c (current diff) 47f4fbee32c5 (diff) |
children | 8eaa8e06a364 |
files | mercurial/commands.py |
diffstat | 2 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 <pat> include names matching the given patterns -X, --exclude <pat> exclude names matching the given patterns + -b, --branch show branches + -k, --keyword <str> search for keywords + -l, --limit <num> print no more than this many changes + -M, --no-merges do not show merges + -m, --only-merges only show merges -r, --rev <A> show the specified revision or range -p, --patch show patch
--- 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')),