Patchwork forget: access status fields by name, not index

login
register
mail settings
Submitter via Mercurial-devel
Date May 5, 2017, 3:59 p.m.
Message ID <662afd05d757b3cdfb65.1493999992@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20457/
State Accepted
Headers show

Comments

via Mercurial-devel - May 5, 2017, 3:59 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@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
Augie Fackler - May 5, 2017, 11:23 p.m.
On Fri, May 05, 2017 at 08:59:52AM -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@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

queued, thanks

Patch

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)]