[PATCH 1 of 2 STABLE] cmdutil: move range check outside of filerevgen

Nicolas Dumazet nicdumz at gmail.com
Wed Nov 10 11:17:15 CST 2010


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1289408702 -32400
# Node ID ecf4c5747824d244647cbb44e7f6f681ec0f9e2a
# Parent  e80128e40c044ea6619c3dc160df69ad36a8e5ff
cmdutil: move range check outside of filerevgen

Simple refactor, no logic change.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1143,7 +1143,7 @@
                     continue
                 # only yield rev for which we have the changelog, it can
                 # happen while doing "hg log" during a pull or commit
-                if linkrev > maxrev or linkrev >= cl_count:
+                if linkrev >= cl_count:
                     break
 
                 parentlinkrevs = []
@@ -1185,7 +1185,7 @@
 
             # iterate from latest to oldest revision
             for rev, flparentlinkrevs, copied in filerevgen(filelog, last):
-                if rev not in ancestors:
+                if rev > maxrev or rev not in ancestors:
                     continue
                 # XXX insert 1327 fix here
                 if flparentlinkrevs:


More information about the Mercurial-devel mailing list