This is an archive of the discontinued Mercurial Phabricator instance.

copies: add config to preserve old copies (issue5457)
Needs ReviewPublic

Authored by martinvonz on Mar 30 2022, 12:18 AM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

The scenario in issue 5457 gets reported every now and then by our
users (Google developers). This patch adds a fix for it by preserving
existing copies even if the source file no longer exists. That's a bit
of hack, but it's effective and much simpler than the other
alternatives we've considered (such as storing the copy information in
obsmarkers, which would mean that copy tracing would have to follow
both graphs).

The fix only works when copies are stored in changeset extras or
sidedata because the filelog record needs to have the old file nodeid,
which doesn't exist in the parent manifest.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Mar 30 2022, 12:18 AM

What happens to the old (now invalid) value after the rebase ?

What happens to the old (now invalid) value after the rebase ?

Which "value" do you mean? The copy information is stored in the amended commit, so it's not affected by the rebase. It will remain there after commits are rebased on top as usual.

Alphare added a subscriber: Alphare.Apr 6 2022, 6:28 AM

As a knee-jerk reaction to the commit message only, I'd say that I am *very* uncomfortable essentially keeping broken data around. I will need to think about this when I have more time than today, I wanted to say something soon so you wouldn't think this went overlooked.