split: use field names instead of field numbers on scmutil.status
authorAugie Fackler <augie@google.com>
Thu, 14 Nov 2019 15:25:48 -0500
changeset 43685 705738def50c
parent 43684 2d5b991c2192
child 43686 96edd0c38740
split: 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/D7393
hgext/split.py
--- a/hgext/split.py	Thu Nov 14 15:25:40 2019 -0500
+++ b/hgext/split.py	Thu Nov 14 15:25:48 2019 -0500
@@ -152,7 +152,9 @@
         scmutil.movedirstate(repo, ctx.p1())
 
     # Any modified, added, removed, deleted result means split is incomplete
-    incomplete = lambda repo: any(repo.status()[:4])
+    def incomplete(repo):
+        st = repo.status()
+        return any((st.modified, st.added, st.removed, st.deleted))
 
     # Main split loop
     while incomplete(repo):