Patchwork D7402: revset: use field names instead of field numbers on scmutil.status

login
register
mail settings
Submitter phabricator
Date Nov. 15, 2019, 3:42 a.m.
Message ID <b637d903864cf4629f4602b4277b7fea@localhost.localdomain>
Download mbox | patch
Permalink /patch/43243/
State Not Applicable
Headers show

Comments

phabricator - Nov. 15, 2019, 3:42 a.m.
Closed by commit rHGd212d657ba0e: revset: use field names instead of field numbers on scmutil.status (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7402?vs=18092&id=18130

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7402/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7402

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -673,6 +673,7 @@ 
     1: added
     2: removed
     """
+    label = {0: 'modified', 1: 'added', 2: 'removed'}[field]
     hasset = matchmod.patkind(pat) == b'set'
 
     mcache = [None]
@@ -691,7 +692,7 @@ 
         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