Mercurial > hg
diff mercurial/metadata.py @ 45669:e53778ad64bf
salvaged: persist the salvaged set on disk
With the new side data storage, this is trivial.
Differential Revision: https://phab.mercurial-scm.org/D9129
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 15 Sep 2020 10:55:17 +0200 |
parents | 47ad23549b81 |
children | 232c88dd89e3 |
line wrap: on
line diff
--- a/mercurial/metadata.py Tue Sep 29 22:47:54 2020 +0200 +++ b/mercurial/metadata.py Tue Sep 15 10:55:17 2020 +0200 @@ -685,7 +685,7 @@ ADDED_FLAG = int("001" "00", 2) MERGED_FLAG = int("010" "00", 2) REMOVED_FLAG = int("011" "00", 2) -# `100` is reserved for future use +SALVAGED_FLAG = int("100" "00", 2) TOUCHED_FLAG = int("101" "00", 2) COPIED_MASK = int("11", 2) @@ -698,7 +698,7 @@ def encode_files_sidedata(files): - all_files = set(files.touched - files.salvaged) + all_files = set(files.touched) all_files.update(files.copied_from_p1.values()) all_files.update(files.copied_from_p2.values()) all_files = sorted(all_files) @@ -718,6 +718,8 @@ flag |= MERGED_FLAG elif f in files.removed: flag |= REMOVED_FLAG + elif f in files.salvaged: + flag |= SALVAGED_FLAG elif f in files.touched: flag |= TOUCHED_FLAG @@ -768,6 +770,8 @@ md.mark_merged(filename) elif flag & ACTION_MASK == REMOVED_FLAG: md.mark_removed(filename) + elif flag & ACTION_MASK == SALVAGED_FLAG: + md.mark_salvaged(filename) elif flag & ACTION_MASK == TOUCHED_FLAG: md.mark_touched(filename)