Patchwork D7404: tags: use field names instead of field numbers on scmutil.status

login
register
mail settings
Submitter phabricator
Date Nov. 14, 2019, 9:12 p.m.
Message ID <differential-rev-PHID-DREV-ujwkg6f7tcla5mhxqive-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43208/
State Superseded
Headers show

Comments

phabricator - Nov. 14, 2019, 9:12 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  As part of my pytype adventures I want to make scmutil.status no longer a
  subclass of tuple. This is part of that process.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/tags.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/tags.py b/mercurial/tags.py
--- a/mercurial/tags.py
+++ b/mercurial/tags.py
@@ -571,7 +571,18 @@ 
 
     if not local:
         m = matchmod.exact([b'.hgtags'])
-        if any(repo.status(match=m, unknown=True, ignored=True)):
+        st = repo.status(match=m, unknown=True, ignored=True)
+        if any(
+            (
+                st.modified,
+                st.added,
+                st.removed,
+                st.deleted,
+                st.unknown,
+                st.ignored,
+                st.clean,
+            )
+        ):
             raise error.Abort(
                 _(b'working copy of .hgtags is changed'),
                 hint=_(b'please commit .hgtags manually'),