comparison mercurial/commands.py @ 10111:27457d31ae3f

cmdutil: replace sys.maxint with None as default value in loglimit Semantically, it is better to use None over any other value when there is "no value". Using maxint in this context is quite hackish, and is not forward compatible.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Mon, 14 Dec 2009 00:32:29 +0900
parents f780b1098efc
children 56284451a22c
comparison
equal deleted inserted replaced
10110:9ed13f718e53 10111:27457d31ae3f
1922 if opts.get('newest_first'): 1922 if opts.get('newest_first'):
1923 o.reverse() 1923 o.reverse()
1924 displayer = cmdutil.show_changeset(ui, other, opts) 1924 displayer = cmdutil.show_changeset(ui, other, opts)
1925 count = 0 1925 count = 0
1926 for n in o: 1926 for n in o:
1927 if count >= limit: 1927 if limit is not None and count >= limit:
1928 break 1928 break
1929 parents = [p for p in other.changelog.parents(n) if p != nullid] 1929 parents = [p for p in other.changelog.parents(n) if p != nullid]
1930 if opts.get('no_merges') and len(parents) == 2: 1930 if opts.get('no_merges') and len(parents) == 2:
1931 continue 1931 continue
1932 count += 1 1932 count += 1
2177 if opts.get('newest_first'): 2177 if opts.get('newest_first'):
2178 o.reverse() 2178 o.reverse()
2179 displayer = cmdutil.show_changeset(ui, repo, opts) 2179 displayer = cmdutil.show_changeset(ui, repo, opts)
2180 count = 0 2180 count = 0
2181 for n in o: 2181 for n in o:
2182 if count >= limit: 2182 if limit is not None and count >= limit:
2183 break 2183 break
2184 parents = [p for p in repo.changelog.parents(n) if p != nullid] 2184 parents = [p for p in repo.changelog.parents(n) if p != nullid]
2185 if opts.get('no_merges') and len(parents) == 2: 2185 if opts.get('no_merges') and len(parents) == 2:
2186 continue 2186 continue
2187 count += 1 2187 count += 1