[PATCH 7 of 8 V6] context: small refactoring of `isintroducedafter`

Boris Feld boris.feld at octobus.net
Mon Nov 19 11:49:46 EST 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1542637858 0
#      Mon Nov 19 14:30:58 2018 +0000
# Node ID 3b75faab24d72c1e5689d352ff13b87b9f9faa51
# Parent  eb5233fcaf698c868eeb58f81fd9f890bbfaf86e
# EXP-Topic copy-perf
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 3b75faab24d7
context: small refactoring of `isintroducedafter`

This make the next change clearer.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -765,8 +765,10 @@ class basefilectx(object):
     def isintroducedafter(self, changelogrev):
         """True if a filectx has been introduced after a given floor revision
         """
-        return (self.linkrev() >= changelogrev
-                or self._introrev() >= changelogrev)
+        if self.linkrev() >= changelogrev:
+            return True
+        introrev = self._introrev()
+        return introrev >= changelogrev
 
     def introrev(self):
         """return the rev of the changeset which introduced this file revision


More information about the Mercurial-devel mailing list