sparse: access status fields by name instead of deconstructing it
The status tuples has had named fields for a few years now.
--- a/mercurial/sparse.py Sat Jul 08 13:34:19 2017 -0700
+++ b/mercurial/sparse.py Thu Jul 06 22:20:38 2017 -0700
@@ -200,9 +200,8 @@
if not enabled or not repo.vfs.exists('tempsparse'):
return
- origstatus = repo.status()
- modified, added, removed, deleted, a, b, c = origstatus
- if modified or added or removed or deleted:
+ s = repo.status()
+ if s.modified or s.added or s.removed or s.deleted:
# Still have pending changes. Don't bother trying to prune.
return
@@ -389,13 +388,11 @@
Will abort if a file with pending changes is being excluded or included
unless ``force`` is True.
"""
- modified, added, removed, deleted, unknown, ignored, clean = origstatus
-
# Verify there are no pending changes
pending = set()
- pending.update(modified)
- pending.update(added)
- pending.update(removed)
+ pending.update(origstatus.modified)
+ pending.update(origstatus.added)
+ pending.update(origstatus.removed)
sparsematch = matcher(repo)
abort = False