changegroup: restore original behavior of _nextclrevtolocalrev
authorGregory Szorc <gregory.szorc@gmail.com>
Tue, 07 Aug 2018 10:24:49 -0700
changeset 38974 4f06e0360bad
parent 38973 633249d226c7
child 38975 87b737b78bd0
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
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Thu Aug 09 12:03:39 2018 -0400
+++ b/mercurial/changegroup.py	Tue Aug 07 10:24:49 2018 -0700
@@ -604,9 +604,9 @@
     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()