This instance will be upgraded to Heptapod 0.27.1 on 2021-12-08 at 22:00 UTC+1 (a few minutes of down time)

Commit c3295cd9 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

copies: distinguish between merged and touched files during upgrade

This a filenode being different between p1, p2 and result does not necessarily
means a merges happens. For example p2 could be a strict newer version of p1, so
the p2 version is picked by the manifest merging, but then the file is manually
updated before the commit.

In this case the file should be detected as touched.

Differential Revision: https://phab.mercurial-scm.org/D10220
parent f077fc7c0705
Pipeline #19558 failed with stages
in 25 minutes and 33 seconds
......@@ -326,8 +326,8 @@ def _process_merge(p1_ctx, p2_ctx, ctx):
│ (None, Some) │ OR │ ø │🄼 Added │OR 🅀 Salvaged │
│ │🄹 Salvaged[2]│ │ (copied?) │ (copied?) │
├──────────────┼──────────────┼──────────────┼──────────────┼──────────────┤
│ │ │ │ 🄾 Touched │
│ (Some, Some) │🄺 No Changes │ ø │OR 🅁 Salvaged │🄿 Merged
│ │ │ │ 🄾 Touched │ 🄿 Merged
│ (Some, Some) │🄺 No Changes │ ø │OR 🅁 Salvaged │OR 🅂 Touched
│ │ [3] │ │ (copied?) │ (copied?) │
└──────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
......@@ -415,6 +415,7 @@ def _process_merge(p1_ctx, p2_ctx, ctx):
nice bonus. However do not any of this yet.
"""
repo = ctx.repo()
md = ChangingFiles()
m = ctx.manifest()
......@@ -462,8 +463,15 @@ def _process_merge(p1_ctx, p2_ctx, ctx):
# case 🄽 🄾 : touched
md.mark_touched(filename)
else:
# case 🄿 : merged
md.mark_merged(filename)
fctx = repo.filectx(filename, fileid=d1[1][0])
if fctx.p2().rev() == nullrev:
# case 🅂
# lets assume we can trust the file history. If the
# filenode is not a merge, the file was not merged.
md.mark_touched(filename)
else:
# case 🄿
md.mark_merged(filename)
copy_candidates.append(filename)
else:
# Impossible case, the post-merge file status cannot be None on
......
......@@ -1965,25 +1965,13 @@ We upgrade a repository that is not using sidedata (the filelog case) and
##### revision "mBF-change-m-0 merge with extra change - B side" #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d' (no-upgraded no-upgraded-parallel !)
touched : d, ; (no-upgraded no-upgraded-parallel !)
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d' (upgraded missing-correct-output !)
touched : d, ; (upgraded missing-correct-output !)
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' (upgraded known-bad-output !)
merged : d, ; (upgraded known-bad-output !)
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d' (upgraded-parallel missing-correct-output !)
touched : d, ; (upgraded-parallel missing-correct-output !)
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' (upgraded-parallel known-bad-output !)
merged : d, ; (upgraded-parallel known-bad-output !)
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
touched : d, ;
##### revision "mFB-change-m-0 merge with extra change - B side" #####
1 sidedata entries
entry-0014 size 14
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d' (no-upgraded no-upgraded-parallel !)
touched : d, ; (no-upgraded no-upgraded-parallel !)
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' (upgraded-parallel known-bad-output !)
merged : d, ; (upgraded-parallel known-bad-output !)
'\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' (upgraded known-bad-output !)
merged : d, ; (upgraded known-bad-output !)
'\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
touched : d, ;
##### revision "mCB-change-m-0 merge explicitely revive deleted file - B side" #####
1 sidedata entries
entry-0014 size 14
......@@ -3418,10 +3406,8 @@ Merge:
A d
h (filelog !)
h (sidedata !)
a (upgraded known-bad-output !)
h (upgraded missing-correct-output !)
a (upgraded-parallel known-bad-output !)
h (upgraded-parallel missing-correct-output !)
h (upgraded !)
h (upgraded-parallel !)
h (changeset !)
h (compatibility !)
A t
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment