diff mercurial/context.py @ 46842:ad878e3f282b

refactor: prefer lookup by revision, even for null While the nullid lookup is a special case, it is still more complicated. The common pattern is to lookup via nullrev so be consistent here. Differential Revision: https://phab.mercurial-scm.org/D10280
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 30 Mar 2021 02:33:12 +0200
parents d4ba4d51f85f
children 728d89f6f9b1
line wrap: on
line diff
--- a/mercurial/context.py	Mon Mar 29 01:35:54 2021 +0200
+++ b/mercurial/context.py	Tue Mar 30 02:33:12 2021 +0200
@@ -3000,7 +3000,7 @@
             parents = [repo[p] for p in parents if p is not None]
         parents = parents[:]
         while len(parents) < 2:
-            parents.append(repo[nullid])
+            parents.append(repo[nullrev])
         p1, p2 = self._parents = parents
 
         # sanity check to ensure that the reused manifest parents are