This patch deletes the config option infinitepush.fillmetadatabranchpattern
which if set to true sets a background process which will save metadata in
infinitepush index.
This series is meant to have a state where we can use it for CI purposes.
indygreg |
hg-reviewers |
This patch deletes the config option infinitepush.fillmetadatabranchpattern
which if set to true sets a background process which will save metadata in
infinitepush index.
This series is meant to have a state where we can use it for CI purposes.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/infinitepush/__init__.py (16 lines) | |||
M | tests/test-infinitepush.t (28 lines) |
# Server-side option. Used only if indextype=sql. | # Server-side option. Used only if indextype=sql. | ||||
# Name of the repository | # Name of the repository | ||||
reponame = '' | reponame = '' | ||||
# Client-side option. Used by --list-remote option. List of remote scratch | # Client-side option. Used by --list-remote option. List of remote scratch | ||||
# patterns to list if no patterns are specified. | # patterns to list if no patterns are specified. | ||||
defaultremotepatterns = ['*'] | defaultremotepatterns = ['*'] | ||||
# Server-side option. If bookmark that was pushed matches | |||||
# `fillmetadatabranchpattern` then background | |||||
# `hg debugfillinfinitepushmetadata` process will save metadata | |||||
# in infinitepush index for nodes that are ancestor of the bookmark. | |||||
fillmetadatabranchpattern = '' | |||||
# Instructs infinitepush to forward all received bundle2 parts to the | # Instructs infinitepush to forward all received bundle2 parts to the | ||||
# bundle for storage. Defaults to False. | # bundle for storage. Defaults to False. | ||||
storeallparts = True | storeallparts = True | ||||
[remotenames] | [remotenames] | ||||
# Client-side option | # Client-side option | ||||
# This option should be set only if remotenames extension is enabled. | # This option should be set only if remotenames extension is enabled. | ||||
# Whether remote bookmarks are tracked by remotenames extension. | # Whether remote bookmarks are tracked by remotenames extension. | ||||
default='', | default='', | ||||
) | ) | ||||
configitem('infinitepush', 'indextype', | configitem('infinitepush', 'indextype', | ||||
default='', | default='', | ||||
) | ) | ||||
configitem('infinitepush', 'indexpath', | configitem('infinitepush', 'indexpath', | ||||
default='', | default='', | ||||
) | ) | ||||
configitem('infinitepush', 'fillmetadatabranchpattern', | |||||
default='', | |||||
) | |||||
configitem('infinitepush', 'storeallparts', | configitem('infinitepush', 'storeallparts', | ||||
default=False, | default=False, | ||||
) | ) | ||||
configitem('infinitepush', 'reponame', | configitem('infinitepush', 'reponame', | ||||
default='', | default='', | ||||
) | ) | ||||
configitem('scratchbranch', 'storepath', | configitem('scratchbranch', 'storepath', | ||||
default='', | default='', | ||||
index.addbundle(key, nodesctx) | index.addbundle(key, nodesctx) | ||||
if bookmark: | if bookmark: | ||||
index.addbookmark(bookmark, bookmarknode) | index.addbookmark(bookmark, bookmarknode) | ||||
_maybeaddpushbackpart(op, bookmark, bookmarknode, | _maybeaddpushbackpart(op, bookmark, bookmarknode, | ||||
bookprevnode, params) | bookprevnode, params) | ||||
log(scratchbranchparttype, eventtype='success', | log(scratchbranchparttype, eventtype='success', | ||||
elapsedms=(time.time() - parthandlerstart) * 1000) | elapsedms=(time.time() - parthandlerstart) * 1000) | ||||
fillmetadatabranchpattern = op.repo.ui.config( | |||||
'infinitepush', 'fillmetadatabranchpattern', '') | |||||
if bookmark and fillmetadatabranchpattern: | |||||
__, __, matcher = util.stringmatcher(fillmetadatabranchpattern) | |||||
if matcher(bookmark): | |||||
_asyncsavemetadata(op.repo.root, | |||||
[ctx.hex() for ctx in nodesctx]) | |||||
except Exception as e: | except Exception as e: | ||||
log(scratchbranchparttype, eventtype='failure', | log(scratchbranchparttype, eventtype='failure', | ||||
elapsedms=(time.time() - parthandlerstart) * 1000, | elapsedms=(time.time() - parthandlerstart) * 1000, | ||||
errormsg=str(e)) | errormsg=str(e)) | ||||
raise | raise | ||||
finally: | finally: | ||||
if bundle: | if bundle: | ||||
bundle.close() | bundle.close() |
remote: 3edfe7e9089a add and rm files | remote: 3edfe7e9089a add and rm files | ||||
remote: c7ac39f638c6 cpfile and mvfile | remote: c7ac39f638c6 cpfile and mvfile | ||||
remote: 09904fb20c53 add many files | remote: 09904fb20c53 add many files | ||||
$ cd ../repo | $ cd ../repo | ||||
$ hg debugfillinfinitepushmetadata --node 09904fb20c53ff351bd3b1d47681f569a4dab7e5 --config infinitepush.metadatafilelimit=2 | $ hg debugfillinfinitepushmetadata --node 09904fb20c53ff351bd3b1d47681f569a4dab7e5 --config infinitepush.metadatafilelimit=2 | ||||
$ cat .hg/scratchbranches/index/nodemetadatamap/09904fb20c53ff351bd3b1d47681f569a4dab7e5 | $ cat .hg/scratchbranches/index/nodemetadatamap/09904fb20c53ff351bd3b1d47681f569a4dab7e5 | ||||
{"changed_files": {"file": {"adds": 1, "isbinary": false, "removes": 0, "status": "added"}, "file1": {"adds": 1, "isbinary": false, "removes": 0, "status": "added"}}, "changed_files_truncated": true} (no-eol) | {"changed_files": {"file": {"adds": 1, "isbinary": false, "removes": 0, "status": "added"}, "file1": {"adds": 1, "isbinary": false, "removes": 0, "status": "added"}}, "changed_files_truncated": true} (no-eol) | ||||
Test infinitepush.fillmetadatabranchpattern | |||||
$ cd ../repo | |||||
$ cat >> .hg/hgrc << EOF | |||||
> [infinitepush] | |||||
> fillmetadatabranchpattern=re:scratch/fillmetadata/.* | |||||
> EOF | |||||
$ cd ../client | |||||
$ echo tofillmetadata > tofillmetadata | |||||
$ hg ci -Aqm "tofillmetadata" | |||||
$ hg log -r . -T '{node}\n' | |||||
d2b0410d4da084bc534b1d90df0de9eb21583496 | |||||
$ hg push -r . -B scratch/fillmetadata/fill | |||||
pushing to ssh://user@dummy/repo | |||||
searching for changes | |||||
remote: pushing 6 commits: | |||||
remote: 33910bfe6ffe testpullbycommithash1 | |||||
remote: d8fde0ddfc96 testpullbycommithash2 | |||||
remote: 3edfe7e9089a add and rm files | |||||
remote: c7ac39f638c6 cpfile and mvfile | |||||
remote: 09904fb20c53 add many files | |||||
remote: d2b0410d4da0 tofillmetadata | |||||
Make sure background process finished | |||||
$ sleep 3 | |||||
$ cd ../repo | |||||
$ cat .hg/scratchbranches/index/nodemetadatamap/d2b0410d4da084bc534b1d90df0de9eb21583496 | |||||
{"changed_files": {"tofillmetadata": {"adds": 1, "isbinary": false, "removes": 0, "status": "added"}}} (no-eol) |