comparison mercurial/pure/parsers.py @ 48087:79bc60ca5946

dirstate-item: introduce a `any_tracked` property This property is True is the file is tracked anywhere, either the working copy, or any of the parent. Differential Revision: https://phab.mercurial-scm.org/D11524
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 29 Sep 2021 14:51:31 +0200
parents 80783e553bd5
children 418611f18fd8
comparison
equal deleted inserted replaced
48086:80783e553bd5 48087:79bc60ca5946
312 def tracked(self): 312 def tracked(self):
313 """True is the file is tracked in the working copy""" 313 """True is the file is tracked in the working copy"""
314 return self._wc_tracked 314 return self._wc_tracked
315 315
316 @property 316 @property
317 def any_tracked(self):
318 """True is the file is tracked anywhere (wc or parents)"""
319 return self._wc_tracked or self._p1_tracked or self._p2_tracked
320
321 @property
317 def added(self): 322 def added(self):
318 """True if the file has been added""" 323 """True if the file has been added"""
319 return self._wc_tracked and not (self._p1_tracked or self._p2_tracked) 324 return self._wc_tracked and not (self._p1_tracked or self._p2_tracked)
320 325
321 @property 326 @property