Mercurial > public > mercurial-scm > hg-stable
diff mercurial/streamclone.py @ 52389:a260d326458f
stream: create a `e.preserve_volatiles` method directly on StoreEntry
For cache, we will need an atomic operation that detect the file and preserve
it, so we start by creating an API that make such atomic operation possible. We
will actually make things atomic in the next changesets.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 02 Dec 2024 17:00:12 +0100 |
parents | 46574e588017 |
children | 11484a19cd77 |
line wrap: on
line diff
--- a/mercurial/streamclone.py Mon Dec 02 16:01:00 2024 +0100 +++ b/mercurial/streamclone.py Mon Dec 02 17:00:12 2024 +0100 @@ -714,9 +714,8 @@ with util.nogc(): # record the expected size of every file for k, vfs, e in entries: + e.preserve_volatiles(vfs, volatiles) for f in e.files(): - if f.is_volatile: - volatiles(vfs.join(f.unencoded_path)) file_count += 1 totalfilesize += f.file_size(vfs) @@ -777,11 +776,11 @@ # make sure we preserve volatile files for k, vfs, e in entries: if e.maybe_volatile: + e.preserve_volatiles(vfs, volatiles) for f in e.files(): if f.is_volatile: # record the expected size under lock f.file_size(vfs) - volatiles(vfs.join(f.unencoded_path)) total_entry_count = len(entries)