# HG changeset patch # User Nicolas Dumazet # Date 1278147528 -32400 # Node ID 326ab8727a9354e1c07a3573292c07d305841eab # Parent 2eab5025f804e7edd6a9fd6d84a056834a2ed128 log: refactor: compute the value of last outside of filerevgen diff -r 2eab5025f804 -r 326ab8727a93 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Fri Jul 16 18:35:15 2010 +0200 +++ b/mercurial/cmdutil.py Sat Jul 03 17:58:48 2010 +0900 @@ -1052,12 +1052,8 @@ if not slowpath: # Only files, no patterns. Check the history of each file. - def filerevgen(filelog, node): + def filerevgen(filelog, last): cl_count = len(repo) - if node is None: - last = len(filelog) - 1 - else: - last = filelog.rev(node) for i, window in increasing_windows(last, nullrev): revs = [] for j in xrange(i - window, i + 1): @@ -1088,7 +1084,13 @@ break else: continue - for rev, copied in filerevgen(filelog, node): + + if node is None: + last = len(filelog) - 1 + else: + last = filelog.rev(node) + + for rev, copied in filerevgen(filelog, last): if rev <= maxrev: if rev < minrev: break