# HG changeset patch # User Boris Feld # Date 2018-10-09 22:50:36 # Node ID 9fa0d6dd16172d207a9f8b4f5bbd48469391d2b9 # Parent 8a0136f690273d53080e0f4293885f1686dea3a2 context: split `introrev` logic in a sub function We want to add a mechanism to stop iteration early associated to intro rev early in some case. However, it does not make sense to expose it in the public `filectx` API. So we split the code into an internal method instead. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -764,7 +764,7 @@ class basefilectx(object): """True if a filectx has been introduced after a given floor revision """ return (self.linkrev() >= changelogrev - or self.introrev() >= changelogrev) + or self._introrev() >= changelogrev) def introrev(self): """return the rev of the changeset which introduced this file revision @@ -775,6 +775,9 @@ class basefilectx(object): 'linkrev-shadowing' when a file revision is used by multiple changesets. """ + return self._introrev() + + def _introrev(self): toprev = None attrs = vars(self) if r'_changeid' in attrs: