[PATCH 2 of 8] revset: cosmetic changes in spanset range comparison

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Thu May 1 20:45:23 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1398723251 25200
#      Mon Apr 28 15:14:11 2014 -0700
# Node ID 2772b02df67bb5095efbb3c8299bc0f9bcec6007
# Parent  5aa714530dac1de26436a5fb2057d39e06ebdb44
revset: cosmetic changes in spanset range comparison

We use the python syntax for range comparison: `a < x < c`. This is shorter,
more readable and less error prone. This comparison escaped the cleanup make in
e2031c8ca4f8

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2819,11 +2819,11 @@ class spanset(_orderedsetmixin):
         else:
             count = 0
             start = self._start
             end = self._end
             for rev in self._hiddenrevs:
-                if (end < rev <= start) or (start <= rev and rev < end):
+                if (end < rev <= start) or (start <= rev < end):
                     count += 1
             return abs(self._end - self._start) - count
 
     def __getitem__(self, x):
         # Basic implementation to be changed in future patches.


More information about the Mercurial-devel mailing list