Patchwork [4,of,7] revlog: move `nullid` early return sooner in `_revisiondata`

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 20, 2019, 4:37 p.m.
Message ID <8dd3d57f5d4780a1c8e6.1566319049@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41370/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 20, 2019, 4:37 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1565214775 -7200
#      Wed Aug 07 23:52:55 2019 +0200
# Node ID 8dd3d57f5d4780a1c8e6aeccc78c54c856999215
# Parent  bab054f6cc691c74c503e043ee82482695b403a4
# EXP-Topic revisiondata
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 8dd3d57f5d47
revlog: move `nullid` early return sooner in `_revisiondata`

Let us deal with the special case before we start dealing with more generic
case.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1618,12 +1618,13 @@  class revlog(object):
             node = nodeorrev
             rev = None
 
+        if node == nullid:
+            return ""
+
         cachedrev = None
         flags = None
         rawtext = None
         basetext = None
-        if node == nullid:
-            return ""
         if self._revisioncache:
             if self._revisioncache[0] == node:
                 # _cache only stores rawtext