# HG changeset patch # User Gregory Szorc # Date 2018-08-07 17:24:49 # Node ID 4f06e0360bad2ed6533e899a0e47793ce601b120 # Parent 633249d226c74c1fe4467aaa3f9c1bcdbe10e733 changegroup: restore original behavior of _nextclrevtolocalrev 0548f696795b accidentally changed the behavior of cgpacker._close(). The old behavior moved _nextclrevtolocalrev to _clrevtolocalrev only when _nextclrevtolocalrev was present and then removed _nextclrevtolocalrev. The bad behavior performed this move then cleared _clrevtolocalrev because it was the same object as _nextclrevtolocalrev. This commit restores the previous behavior. Surprisingly, no tests changed as a result of this bad logic. I'm not sure why. Differential Revision: https://phab.mercurial-scm.org/D4155 diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -604,9 +604,9 @@ class cgpacker(object): def _close(self): # Ellipses serving mode. self._clrevtolocalrev.clear() - if self._nextclrevtolocalrev: + if self._nextclrevtolocalrev is not None: self._clrevtolocalrev = self._nextclrevtolocalrev - self._nextclrevtolocalrev.clear() + self._nextclrevtolocalrev = None self._changelogdone = True return closechunk()