changeset 37378:953db9e00eeb

rebase: remove unnecessary and incorrect handling of nullid We used to write a nullid as hex to the rebase state file and interpret it as the "todo" state (value -1). However, when reading it, we compared the string value to (binary) nullid, which would of course not match. AFAICT, it still worked because when the read nodeid did not match nullid (which, again, it didn't), we'd use the normal path which did repo[<hex nullid>].rev(), and that also happens to return -1. It seems to have been this way ever since 9972758ab4c5 (rebase: handle revtodo as a special value when storing/restoring state, 2014-12-02). Differential Revision: https://phab.mercurial-scm.org/D3140
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 05 Apr 2018 11:01:42 -0700
parents 3dfd7f018c69
children 24c7428983c5
files hgext/rebase.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Apr 05 10:13:45 2018 -0700
+++ b/hgext/rebase.py	Thu Apr 05 11:01:42 2018 -0700
@@ -21,7 +21,6 @@
 
 from mercurial.i18n import _
 from mercurial.node import (
-    nullid,
     nullrev,
     short,
 )
@@ -252,7 +251,7 @@
                     else:
                         destrev = legacydest
                     destmap[oldrev] = destrev
-                    if newrev in (nullid, revtodostr):
+                    if newrev == revtodostr:
                         state[oldrev] = revtodo
                         # Legacy compat special case
                     else: