revlog: move `nullid` early return sooner in `_revisiondata`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 07 Aug 2019 23:52:55 +0200
changeset 42805 bf070a59546a
parent 42804 2eec53a99ec1
child 42806 616aa62e5027
revlog: move `nullid` early return sooner in `_revisiondata` Let us deal with the special case before we start dealing with more generic case.
mercurial/revlog.py
--- a/mercurial/revlog.py	Wed Aug 07 23:48:54 2019 +0200
+++ b/mercurial/revlog.py	Wed Aug 07 23:52:55 2019 +0200
@@ -1618,12 +1618,13 @@
             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