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

login
register
mail settings
Submitter Boris Feld
Date Nov. 19, 2018, 4:49 p.m.
Message ID <3b75faab24d72c1e5689.1542646186@localhost.localdomain>
Download mbox | patch
Permalink /patch/36655/
State Accepted
Headers show

Comments

Boris Feld - Nov. 19, 2018, 4:49 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@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.

Patch

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