Mercurial > hg
comparison hgext/largefiles/overrides.py @ 47654:2af9709ea13c
largefile: use `set_untracked` in the `forget` override
This is the new shinny API.
Differential Revision: https://phab.mercurial-scm.org/D11110
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 08 Jul 2021 03:50:08 +0200 |
parents | 00d70f61d856 |
children | 0ab58b1f228f |
comparison
equal
deleted
inserted
replaced
47653:00d70f61d856 | 47654:2af9709ea13c |
---|---|
1378 # Need to lock because standin files are deleted then removed from the | 1378 # Need to lock because standin files are deleted then removed from the |
1379 # repository and we could race in-between. | 1379 # repository and we could race in-between. |
1380 with repo.wlock(): | 1380 with repo.wlock(): |
1381 lfdirstate = lfutil.openlfdirstate(ui, repo) | 1381 lfdirstate = lfutil.openlfdirstate(ui, repo) |
1382 for f in forget: | 1382 for f in forget: |
1383 if lfdirstate[f] == b'a': | 1383 lfdirstate.set_untracked(f) |
1384 lfdirstate.drop(f) | |
1385 else: | |
1386 lfdirstate.remove(f) | |
1387 lfdirstate.write() | 1384 lfdirstate.write() |
1388 standins = [lfutil.standin(f) for f in forget] | 1385 standins = [lfutil.standin(f) for f in forget] |
1389 for f in standins: | 1386 for f in standins: |
1390 repo.wvfs.unlinkpath(f, ignoremissing=True) | 1387 repo.wvfs.unlinkpath(f, ignoremissing=True) |
1391 rejected = repo[None].forget(standins) | 1388 rejected = repo[None].forget(standins) |