Patchwork revert: access status fields by name rather than index

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 20, 2014, 6:05 a.m.
Message ID <fe77e434dbce76dab536.1416463555@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6808/
State Accepted
Commit aa0a430d9c75e3fcd0589c1620796857b32d2497
Headers show

Comments

Martin von Zweigbergk - Nov. 20, 2014, 6:05 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1416445647 28800
#      Wed Nov 19 17:07:27 2014 -0800
# Node ID fe77e434dbce76dab5360829aa19912f3a297cc9
# Parent  cc83cac41619b32375b28f821237fb0747010b80
revert: access status fields by name rather than index

For better readability.
Pierre-Yves David - Nov. 20, 2014, 6:47 a.m.
On 11/19/2014 10:05 PM, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1416445647 28800
> #      Wed Nov 19 17:07:27 2014 -0800
> # Node ID fe77e434dbce76dab5360829aa19912f3a297cc9
> # Parent  cc83cac41619b32375b28f821237fb0747010b80
> revert: access status fields by name rather than index
>
> For better readability.

Nice, pushed to the clowncopter.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2590,13 +2590,13 @@ 
 
             m = scmutil.matchfiles(repo, names)
 
-        modified = set(changes[0])
-        added    = set(changes[1])
-        removed  = set(changes[2])
-        _deleted = set(changes[3])
-        unknown  = set(changes[4])
-        unknown.update(changes[5])
-        clean    = set(changes[6])
+        modified = set(changes.modified)
+        added    = set(changes.added)
+        removed  = set(changes.removed)
+        _deleted = set(changes.deleted)
+        unknown  = set(changes.unknown)
+        unknown.update(changes.ignored)
+        clean    = set(changes.clean)
         modadded = set()
 
         # split between files known in target manifest and the others
@@ -2618,9 +2618,9 @@ 
             modified, added, removed = set(), set(), set()
         else:
             changes = repo.status(node1=parent, match=m)
-            dsmodified = set(changes[0])
-            dsadded    = set(changes[1])
-            dsremoved  = set(changes[2])
+            dsmodified = set(changes.modified)
+            dsadded    = set(changes.added)
+            dsremoved  = set(changes.removed)
 
             # only take into account for removes between wc and target
             clean |= dsremoved - removed