From 7f1c4eb449a9ea269a7daaf1b4af84c38094ec0b Mon Sep 17 00:00:00 2001 From: Adam Simpkins Date: Thu, 13 Oct 2016 11:49:58 -0700 Subject: [PATCH] [sparse] make sure "hg update --clean" correctly forgets about excluded files Summary: A user ran into a bug where a failed rebase left their repository in a state where "hg status" reported many excluded files had been removed. They weren't able to recover from this state, even using "hg update --clean ." This was because the sparse extension was ignoring the actions to forget these files from the dirstate. The sparse extension should allow excluded files to be forgotten. Test Plan: I tried writing a test case for this but wasn't able to figure out how to trigger exactly the situation that the user's repository was in. (It looks like there were other bugs in "hg rebase --abort" that led to their repository state.) I was able to cause some other problems with files in the "g" type ("remote created") that "hg update --clean" wouldn't fix. I haven't added those test cases for now though, since that problem isnt' fixed by this diff. It does seem like there are potentially other problems here that still need to be addressed. Reviewers: quark, rmcelroy, mjpieters, durham Reviewed By: durham Subscribers: net-systems-diffs@, yogeshwer, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D3966580 Tasks: 13694820 Signature: t1:3966580:1475676328:48433e203ae702a50b40176e52f1ed90a5c45504 --- hgext3rd/sparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hgext3rd/sparse.py b/hgext3rd/sparse.py index 0d75ea6e25..f8726ffce4 100644 --- a/hgext3rd/sparse.py +++ b/hgext3rd/sparse.py @@ -106,6 +106,8 @@ def _setupupdates(ui): if type != 'k': temporaryfiles.append(file) prunedactions[file] = action + elif type == 'f': + prunedactions[file] = action elif file in wctx: prunedactions[file] = ('r', args, msg)