Mercurial > hg-stable
changeset 24910:80a711e91507
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.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 23 Apr 2015 09:44:22 -0700 |
parents | d71492ca2fdd |
children | 5447b8523fef |
files | mercurial/changegroup.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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)