[PATCH] forget: access status fields by name, not index

Martin von Zweigbergk martinvonz at google.com
Fri May 5 15:59:52 UTC 2017


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1493957500 25200
#      Thu May 04 21:11:40 2017 -0700
# Node ID 662afd05d757b3cdfb65c949330d5fba1804b003
# Parent  2cfdf5241096f6c0c2d45d32b2f1a41575835025
forget: access status fields by name, not index

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2309,7 +2309,7 @@
     forgot = []
 
     s = repo.status(match=matchmod.badmatch(match, badfn), clean=True)
-    forget = sorted(s[0] + s[1] + s[3] + s[6])
+    forget = sorted(s.modified + s.added + s.deleted + s.clean)
     if explicitonly:
         forget = [f for f in forget if match.exact(f)]
 


More information about the Mercurial-devel mailing list