# HG changeset patch
# User Lucas Moscovicz <lmoscovicz@fb.com>
# Date 2014-03-14 20:27:12
# Node ID d5fa413346e70fbd8aba96aa1d01562a64af2ac8
# Parent  74139960c302ac8ca58c19335f5fb115bcec0e24

cmdutil: changed max method for lazy call

Used the lazy max call instead of the python max implementation to be able to
use lazysets for graphlog.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1711,7 +1711,7 @@ def graphlog(ui, repo, *pats, **opts):
     if opts.get('copies'):
         endrev = None
         if opts.get('rev'):
-            endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1
+            endrev = scmutil.revrange(repo, opts.get('rev')).max() + 1
         getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
     displayer = show_changeset(ui, repo, opts, buffered=True)
     showparents = [ctx.node() for ctx in repo[None].parents()]