##// END OF EJS Templates
bookmark: add a 'check:bookmarks' bundle2 part...
bookmark: add a 'check:bookmarks' bundle2 part This part checks that bookmarks are still at the node they are expected to be. This allows a pushing client to detect push race where the repository was updated between the time it discovered the server state and the time it managed to finish its push. Such checking already exists when pushing bookmark through pushkey. This new part can be inserted at the beginning of the bundle, triggering abort earlier. In addition, we would like to move away from pushey to push bookmark. A step useful to solve issue5165.

File last commit:

r35234:f0445eea default
r35259:dbf86862 default
Show More
common-pattern.py
75 lines | 2.2 KiB | text/x-python | PythonLexer
/ tests / common-pattern.py
Boris Feld
test-pattern: substitute common compression list...
r35069 # common patterns in test at can safely be replaced
from __future__ import absolute_import
substitutions = [
# list of possible compressions
Boris Feld
test: fix common-pattern for pure variant...
r35234 (br'(zstd,)?zlib,none,bzip2',
Boris Feld
test-pattern: substitute common compression list...
r35069 br'$USUAL_COMPRESSIONS$'
),
Boris Feld
test-pattern: register current the bundlecaps string...
r35070 # capabilities sent through http
(br'bundlecaps=HG20%2Cbundle2%3DHG20%250A'
br'changegroup%253D01%252C02%250A'
br'digests%253Dmd5%252Csha1%252Csha512%250A'
br'error%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250A'
br'hgtagsfnodes%250A'
br'listkeys%250A'
br'phases%253Dheads%250A'
br'pushkey%250A'
br'remote-changegroup%253Dhttp%252Chttps',
# (the replacement patterns)
br'$USUAL_BUNDLE_CAPS$'
),
Boris Feld
test-pattern: register the current the bundle2 capabilities string...
r35071 # bundle2 capabilities sent through ssh
(br'bundle2=HG20%0A'
br'changegroup%3D01%2C02%0A'
br'digests%3Dmd5%2Csha1%2Csha512%0A'
br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A'
br'hgtagsfnodes%0A'
br'listkeys%0A'
br'phases%3Dheads%0A'
br'pushkey%0A'
br'remote-changegroup%3Dhttp%2Chttps',
# (replacement patterns)
br'$USUAL_BUNDLE2_CAPS$'
),
Boris Feld
test-pattern: substitute the HTTP log timestamp too...
r35072 # HTTP log dates
(br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "GET',
br' - - [$LOGDATE$] "GET'
),
Boris Feld
test-pattern: substitute common compression list...
r35069 ]
Matt Harbison
tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages...
r35230
# Various platform error strings, keyed on a common replacement string
_errors = {
br'$ENOENT$': (
# strerror()
br'No such file or directory',
# FormatMessage(ERROR_FILE_NOT_FOUND)
br'The system cannot find the file specified',
),
Matt Harbison
tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
r35231 br'$ENOTDIR$': (
# strerror()
br'Not a directory',
# FormatMessage(ERROR_PATH_NOT_FOUND)
br'The system cannot find the path specified',
),
Matt Harbison
tests: add a substitution for ECONNRESET/WSAECONNRESET messages
r35232 br'$ECONNRESET$': (
# strerror()
br'Connection reset by peer',
# FormatMessage(WSAECONNRESET)
br'An existing connection was forcibly closed by the remote host',
),
Matt Harbison
tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages...
r35233 br'$EADDRINUSE$': (
# strerror()
br'Address already in use',
# FormatMessage(WSAEADDRINUSE)
br'Only one usage of each socket address'
br' \(protocol/network address/port\) is normally permitted',
),
Matt Harbison
tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages...
r35230 }
for replace, msgs in _errors.items():
substitutions.extend((m, replace) for m in msgs)