changegroup: use 'reorder is None' instead of 'reorder is not True/False'
The config option bundle.reorder can be {on,off,auto}, which gets read
into the 'reorder' variable as {True,False,None}. In two places, we
need to decide how to handle the None/auto case. I personally find it
easier to read those expressions when written to explicitly compare to
None.
--- a/mercurial/changegroup.py Thu Apr 09 23:47:07 2015 -0400
+++ b/mercurial/changegroup.py Thu Apr 23 09:44:22 2015 -0700
@@ -325,7 +325,7 @@
# for generaldelta revlogs, we linearize the revs; this will both be
# much quicker and generate a much smaller bundle
- if (revlog._generaldelta and reorder is not False) or reorder:
+ if (revlog._generaldelta and reorder is None) or reorder:
dag = dagutil.revlogdag(revlog)
revs = set(revlog.rev(n) for n in nodelist)
revs = dag.linearize(revs)
@@ -511,7 +511,7 @@
deltaheader = _CHANGEGROUPV2_DELTA_HEADER
def group(self, nodelist, revlog, lookup, units=None, reorder=None):
- if (revlog._generaldelta and reorder is not True):
+ if (revlog._generaldelta and reorder is None):
reorder = False
return super(cg2packer, self).group(nodelist, revlog, lookup,
units=units, reorder=reorder)