sapling/edenscm/hgext
Xavier Deguillard 74e48dfde3 treemanifest: delay packfile addition when using linkrev
Summary:
In order to provide fast "hg blame" for a file, Mercurial keeps an auxiliary
data attached to every filenode: the linknode. This linknode is a backpointer
to the revision that introduced the linknode.

While the linknode allows for very fast blame, it also has a big drawback: the
commit DAG has cycles. This makes for an awkward commit logic where the data
needed by a commit also needs the commit hash.

The solution that was taken up to now was to delay the write to the historypack
until it's closed and use "linkrev" until then. By the time the historypack is
closed the changelog will have been updated and the linkrev can be resolved to
a valid linknode. The drawback of this solution is that the historypack (and
other future stores) needs to have an understanding of what the changelog is to
be able to interpret linkrevs. It also prevents the store from being able to
blindly store data on disk as it is received.

For now, let's solve this by moving the handling of linkrev one layer up, and
recognizing when a linkrev is used and simply waiting until the changelog is
updated before adding the resolved linknode to the historypack.

A better solution to this problem is to simply not have a linknode in the
historypack, and instead have an auxiliary file where linknodes are stored.
This will remove the chicken-egg issue as this auxiliary file can be written
after the changelog is updated.

Most of the logic in this patch was inspired by a similar hack in
remotefilelog.

Reviewed By: DurhamG

Differential Revision: D15684624

fbshipit-source-id: 578c42349d6c6f572ff578de0495f2e762814cd2
2019-06-17 14:01:30 -07:00
..
absorb mutation: add absorb support 2019-04-11 02:45:16 -07:00
amend strip: alias strip to hide instead of prune 2019-06-03 08:48:25 -07:00
commitcloud add hg cloud status command 2019-06-13 05:53:22 -07:00
convert subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
extlib rust: update to 2018 edition 2019-06-03 07:22:36 -07:00
fastannotate hgext: reformat using black 2019-03-13 18:35:09 -07:00
fastmanifest manifest: remove readfast, replace readdelta 2019-05-24 10:00:49 -07:00
fsmonitor debugrefreshwatchmanclock: don't trigger commitcloud autobackup 2019-05-16 02:40:26 -07:00
hgevents codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
hggit hggit: stop git-updatemeta walk when we finish commits with extras 2019-03-20 14:33:58 -07:00
hgsubversion hgsubversion: move to absolute import 2019-05-21 09:15:21 -07:00
highlight codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
infinitepush infinitepush: add replaybookmarksqueue 2019-06-17 06:19:12 -07:00
lfs tracing: record lfs download size 2019-05-03 13:09:33 -07:00
memcommit memcommit: enforce target parent to be original parent 2019-03-13 11:50:42 -07:00
p4fastimport Make importer respect commits not done by itself 2019-05-10 10:10:57 -07:00
perfsuite metrics: slightly change the API 2019-03-20 22:49:18 -07:00
pushrebase disable pushrebase during infinitepush 2019-05-31 08:57:14 -07:00
remotefilelog edenapi: add support for streaming responses 2019-06-13 10:18:46 -07:00
repogenerator codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
treemanifest treemanifest: delay packfile addition when using linkrev 2019-06-17 14:01:30 -07:00
__init__.py codemod: move Python packages to edenscm 2019-01-28 18:35:41 -08:00
arcdiff.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
automv.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
blackbox.py blackbox: only log current commit if the changelog has been loaded 2019-05-30 04:02:54 -07:00
catnotate.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
checkmessagehook.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
checkserverbookmark.py mononoke: review bookmarks: embed hg extension 2019-06-12 06:13:28 -07:00
chistedit.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
churn.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
cleanobsstore.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
clienttelemetry.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
clindex.pyx blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
clonebundles.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
commitextras.py test-revset: do not use "hg branch" directly 2019-02-14 17:44:39 -08:00
conflictinfo.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
copytrace.py copytrace: fix an issue where undesirable entries are reported 2019-02-25 12:43:20 -08:00
crdump.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
debugcommitmessage.py subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
debugshell.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
dialect.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
directaccess.py branchmap: drop revbranchcache and other unused logic 2019-02-22 21:02:41 -08:00
dirsync.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
disablesymlinks.py disablesymlinks: add extension to disable symlinks 2019-02-06 08:41:34 -08:00
drop.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
edrecord.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
eol.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
errorredirect.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
extdiff.py subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
extorder.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
extutil.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
fastlog.py fastlog: patch follow revset instead 2019-04-16 22:19:19 -07:00
fbconduit.py globalrevs: allow scmquery based lookups from 'globalrev->hash' on clients 2019-06-04 11:59:12 -07:00
fbhistedit.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
fixcorrupt.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
generic_bisect.py codemod: move Python packages to edenscm 2019-01-28 18:35:41 -08:00
githelp.py githelp: update branch -d suggestions 2019-06-03 08:48:25 -07:00
gitlookup.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
gitrevset.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
globalrevs.py globalrevs: avoid scanning changelog when looking for commit with svnrev 0 2019-06-14 18:29:40 -07:00
gpg.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
grepdiff.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
grpcheck.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
hgsql.py hgsql: use mmap for hgsql revlog validation 2019-05-23 10:50:29 -07:00
hiddenerror.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
histedit.py histedit: fix call to hex in loginfo 2019-04-12 01:57:56 -07:00
infinitepushbackup.py commitcloud: incorporate infinitepush backups into commitcloud 2019-05-20 06:19:47 -07:00
interactiveui.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
journal.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
linkrevcache.py manifest: remove readfast, replace readdelta 2019-05-24 10:00:49 -07:00
logginghelper.py logginghelper: log normalized repo name 2019-03-04 00:05:00 -08:00
lz4revlog.py rust: move bindings to a single python extension 2019-02-01 17:53:22 -08:00
mergedriver.py tracing: trace mergedriver 2019-05-09 08:08:19 -07:00
morecolors.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
morestatus.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
myparent.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
nointerrupt.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
ownercheck.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
patchrmdir.pyx codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
phabdiff.py hg | phabdiff | Properly handle both 't' and 'T' prefixes for tasks when parsing them out of commit messages. 2019-04-29 14:41:38 -07:00
phabstatus.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
phrevset.py phrevset: avoid crashing on null graphql reply 2019-04-09 07:53:43 -07:00
progressfile.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
pullcreatemarkers.py visibility: pullcreatemarkers should exclude hidden commits 2019-04-11 07:49:21 -07:00
purge.py docs: fix doc indentation error 2019-05-08 09:09:07 -07:00
rage.py add hg cloud status in hg pasterage output 2019-06-13 05:53:22 -07:00
rebase.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
remotenames.py remotenames: fix positional args for selectivepull 2019-06-17 11:45:55 -07:00
reset.py reset: fix visibility interaction 2019-05-03 17:44:51 -07:00
sampling.py sampling: silence BaseException.message deprecation warning 2019-04-22 17:58:07 -07:00
schemes.py hgext: reformat using black 2019-03-13 18:35:09 -07:00
sendunbundlereplay.py mononoke-replay: move unbundlereplay and checkserverbookmark to util.timed 2019-05-25 10:57:49 -07:00
share.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
shelve.py visibility: add shelve support 2019-04-26 01:07:30 -07:00
sigtrace.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
simplecache.py simplecache: add checksum to simplecache values 2019-02-20 13:56:33 -08:00
smartlog.py ui: add labelled prefixes to ui.write 2019-05-09 06:55:11 -07:00
sparse.py blackbox: clean up blackbox logging and log more during rage 2019-04-23 02:48:50 -07:00
sshaskpass.py sshaskpass: workaround sys.executable 2019-02-26 18:19:43 -08:00
stablerev.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
stat.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
traceprof.pyx codemod: move Python packages to edenscm 2019-01-28 18:35:41 -08:00
tweakdefaults.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
undo.py visibility: support undo after split 2019-04-26 01:07:30 -07:00
whereami.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
win32mbcs.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
win32text.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00