# HG changeset patch # User Augie Fackler # Date 2019-11-14 20:28:08 # Node ID d212d657ba0e80137f2a0f673fefb89f7b7339ee # Parent d649de29f1ffb08268752a57e640803df12f0778 revset: use field names instead of field numbers on scmutil.status As part of my pytype adventures I want to make scmutil.status no longer a subclass of tuple. This is part of that process. Differential Revision: https://phab.mercurial-scm.org/D7402 diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -673,6 +673,7 @@ def checkstatus(repo, subset, pat, field 1: added 2: removed """ + label = {0: 'modified', 1: 'added', 2: 'removed'}[field] hasset = matchmod.patkind(pat) == b'set' mcache = [None] @@ -691,7 +692,7 @@ def checkstatus(repo, subset, pat, field else: if not any(m(f) for f in c.files()): return False - files = repo.status(c.p1().node(), c.node())[field] + files = getattr(repo.status(c.p1().node(), c.node()), label) if fname is not None: if fname in files: return True