D7395: uncommit: use field names instead of field numbers on scmutil.status

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Nov 14 21:09:05 UTC 2019


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/D7395

AFFECTED FILES
  hgext/uncommit.py

CHANGE DETAILS

diff --git a/hgext/uncommit.py b/hgext/uncommit.py
--- a/hgext/uncommit.py
+++ b/hgext/uncommit.py
@@ -157,7 +157,8 @@
 
     with repo.wlock(), repo.lock():
 
-        m, a, r, d = repo.status()[:4]
+        st = repo.status()
+        m, a, r, d = st.modified, st.added, st.removed, st.deleted
         isdirtypath = any(set(m + a + r + d) & set(pats))
         allowdirtywcopy = opts[
             b'allow_dirty_working_copy'



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


More information about the Mercurial-devel mailing list