( )⚙ D1304 treemanifest: allow hybrid repos to make treeonly commits

This is an archive of the discontinued Mercurial Phabricator instance.

treemanifest: allow hybrid repos to make treeonly commits
ClosedPublic

Authored by durham on Nov 2 2017, 7:27 PM.
Tags
None
Subscribers

Details

Reviewers
quark
Group Reviewers
Restricted Project
Commits
rFBHGX6776e7a6e931: treemanifest: allow hybrid repos to make treeonly commits
Summary

If a hybrid repo pulls in a treeonly commit from a treeonly client, it
previously couldn't commit on top of it because it tried to read the flat
manifest. This patch makes it possible for the hybrid repo to make a treeonly
commit if it is committing on top of a treeonly commit (i.e. where the manifest
only exists in the tree store, not in the flat manifest revlog).

This makes it easier for multiple types of repositories to interact, and to flip
back and forth between treeonly and non-treeonly as we migrate.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durham created this revision.Nov 2 2017, 7:27 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 2 2017, 7:27 PM
quark added a subscriber: quark.Nov 6 2017, 4:13 PM
quark added inline comments.
fastmanifest/implementation.py
1114

Does this mean each add has to re-lookup the path from starting from p1? If so, it's worth a comment here saying performance could be improved here.

quark accepted this revision.Nov 6 2017, 4:14 PM
This revision is now accepted and ready to land.Nov 6 2017, 4:14 PM
durham added inline comments.Nov 7 2017, 11:58 AM
fastmanifest/implementation.py
1114

I'm not sure what you mean? Re-lookup what path? You mean the delta chain? The caller is responsible for producing delta chains, so in this case we aren't doing any deltas at all.

quark added inline comments.Nov 7 2017, 5:43 PM
fastmanifest/implementation.py
1114

I thought inserting multiple paths like:

/a/b/c/d/1
/a/b/c/d/2

may require a/b/c/d lookups multiple times. Ideally it's:

x = lookup("/a/b/c/d")
x.add("1")
x.add("2")

But the underlying store may be smart enough so it handles this transparently. So I think it's fine to not change high-level code here.

This revision was automatically updated to reflect the committed changes.