diff mercurial/narrowspec.py @ 47759:d7515d29761d stable 5.9rc0

branching: merge default into stable This mark the start of the 5.9 freeze.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 21 Jul 2021 22:52:09 +0200
parents 5bcd305389c7
children 7ed0fc687220
line wrap: on
line diff
--- a/mercurial/narrowspec.py	Fri Jul 09 00:25:14 2021 +0530
+++ b/mercurial/narrowspec.py	Wed Jul 21 22:52:09 2021 +0200
@@ -343,11 +343,14 @@
     for f in sorted(status.ignored):
         repo.ui.status(_(b'not deleting ignored file %s\n') % uipathfn(f))
     for f in clean + trackeddirty:
-        ds.drop(f)
+        ds.update_file(f, p1_tracked=False, wc_tracked=False)
 
     pctx = repo[b'.']
+
+    # only update added files that are in the sparse checkout
+    addedmatch = matchmod.intersectmatchers(addedmatch, sparse.matcher(repo))
     newfiles = [f for f in pctx.manifest().walk(addedmatch) if f not in ds]
     for f in newfiles:
-        ds.normallookup(f)
+        ds.update_file(f, p1_tracked=True, wc_tracked=True, possibly_dirty=True)
     _writeaddedfiles(repo, pctx, newfiles)
     repo._updatingnarrowspec = False