Mercurial > hg
comparison hgext/rebase.py @ 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 | 92213f6745ed |
comparison
equal
deleted
inserted
replaced
37377:3dfd7f018c69 | 37378:953db9e00eeb |
---|---|
19 import errno | 19 import errno |
20 import os | 20 import os |
21 | 21 |
22 from mercurial.i18n import _ | 22 from mercurial.i18n import _ |
23 from mercurial.node import ( | 23 from mercurial.node import ( |
24 nullid, | |
25 nullrev, | 24 nullrev, |
26 short, | 25 short, |
27 ) | 26 ) |
28 from mercurial import ( | 27 from mercurial import ( |
29 bookmarks, | 28 bookmarks, |
250 if len(args) > 2: | 249 if len(args) > 2: |
251 destrev = repo[args[2]].rev() | 250 destrev = repo[args[2]].rev() |
252 else: | 251 else: |
253 destrev = legacydest | 252 destrev = legacydest |
254 destmap[oldrev] = destrev | 253 destmap[oldrev] = destrev |
255 if newrev in (nullid, revtodostr): | 254 if newrev == revtodostr: |
256 state[oldrev] = revtodo | 255 state[oldrev] = revtodo |
257 # Legacy compat special case | 256 # Legacy compat special case |
258 else: | 257 else: |
259 state[oldrev] = repo[newrev].rev() | 258 state[oldrev] = repo[newrev].rev() |
260 | 259 |