comparison hgext/graphlog.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 ffa6f2eb934e
children d6512b3e9ac0
comparison
equal deleted inserted replaced
10110:9ed13f718e53 10111:27457d31ae3f
248 if path: 248 if path:
249 path = util.canonpath(repo.root, os.getcwd(), path) 249 path = util.canonpath(repo.root, os.getcwd(), path)
250 if path: # could be reset in canonpath 250 if path: # could be reset in canonpath
251 revdag = graphmod.filerevs(repo, path, start, stop, limit) 251 revdag = graphmod.filerevs(repo, path, start, stop, limit)
252 else: 252 else:
253 stop = max(stop, start - limit + 1) 253 if limit is not None:
254 stop = max(stop, start - limit + 1)
254 revdag = graphmod.revisions(repo, start, stop) 255 revdag = graphmod.revisions(repo, start, stop)
255 256
256 displayer = show_changeset(ui, repo, opts, buffered=True) 257 displayer = show_changeset(ui, repo, opts, buffered=True)
257 showparents = [ctx.node() for ctx in repo[None].parents()] 258 showparents = [ctx.node() for ctx in repo[None].parents()]
258 generate(ui, revdag, displayer, showparents, asciiedges) 259 generate(ui, revdag, displayer, showparents, asciiedges)
259 260
260 def graphrevs(repo, nodes, opts): 261 def graphrevs(repo, nodes, opts):
261 limit = cmdutil.loglimit(opts) 262 limit = cmdutil.loglimit(opts)
262 nodes.reverse() 263 nodes.reverse()
263 if limit < sys.maxint: 264 if limit is not None:
264 nodes = nodes[:limit] 265 nodes = nodes[:limit]
265 return graphmod.nodes(repo, nodes) 266 return graphmod.nodes(repo, nodes)
266 267
267 def goutgoing(ui, repo, dest=None, **opts): 268 def goutgoing(ui, repo, dest=None, **opts):
268 """show the outgoing changesets alongside an ASCII revision graph 269 """show the outgoing changesets alongside an ASCII revision graph