tests/common-pattern.py
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
Tue, 02 Jul 2019 12:59:58 -0400
changeset 42621 99ebde4fec99
parent 42351 c7652f7440d9
child 43076 2372284d9457
permissions -rw-r--r--
commit: improve the files field of changelog for merges Currently, the files list of merge commits repeats all the deletions (either actual deletions, or files that got renamed) that happened between base and p2 of the merge. If p2 is the main branch, the list can easily be much bigger than the change being merged. This results in various problems worth improving: - changelog is bigger than necessary - `hg log directory` lists many unrelated merge commits, and `hg log -v -r commit` frequently fills multiple screens worth of files - it possibly slows down adjustlinkrev, by forcing it to read more manifests, and that function can certainly be a bottleneck - the server side of pulls can waste a lot of time simply opening the filelogs for pointless files (the constant factors for opening even a tiny filelog is apparently pretty bad) So stop listing such files as described in the code. Impacted merge commits and their descendants get a different hash than they would have without this. This doesn't seem problematic, except for convert. The previous commit helped with that in the hg->hg case (but if you do svn->hg twice from scratch, hashes can still change). The rest of the description is numbers. I don't have much to report, because recreating the files list of existing repositories is not easy: - debugupgradeformat and bundle/unbundle don't recreate the list - export/import tends to choke quickly applying patches or on description that contain diffs, - merge commits from the convert extension don't have the right files list for reasons orthogonal to the current commit - replaying the merge with hg update/hg merge/hg revert --all/hg commit can end up failing in hg revert - I wasn't sure that using debugsetparents + debugrebuilddirstate would really build the right thing I measured commit time before and after this change, in a case with no files filtered out, several files filtered out (no difference) and 5k files filtered out (+1% time). Recreating the 100 more recent merges in a private repo, the concatenated uncompressed files lists goes from 1.12MB to 0.52MB. Excluding 3 merges that are not representative, then the size goes from 570k to 15k. I converted part of mozilla-central, and observed file list shrinking quite a bit too, starting at the very first merge, 733641d9feaf, going from 550 files to 10 files (although they have relatively few merges, so they probably wouldn't care). Differential Revision: https://phab.mercurial-scm.org/D6613
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35093
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     1
# common patterns in test at can safely be replaced
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     2
from __future__ import absolute_import
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     3
35453
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
     4
import os
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
     5
35093
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     6
substitutions = [
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     7
    # list of possible compressions
35243
f0445eea9b93 test: fix common-pattern for pure variant
Boris Feld <boris.feld@octobus.net>
parents: 35242
diff changeset
     8
    (br'(zstd,)?zlib,none,bzip2',
35093
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     9
     br'$USUAL_COMPRESSIONS$'
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    10
    ),
35806
ab239e3de23b tests: add a pattern to fix --pure tests
Augie Fackler <augie@google.com>
parents: 35792
diff changeset
    11
    (br'=(zstd,)?zlib',
ab239e3de23b tests: add a pattern to fix --pure tests
Augie Fackler <augie@google.com>
parents: 35792
diff changeset
    12
     br'=$BUNDLE2_COMPRESSIONS$'
ab239e3de23b tests: add a pattern to fix --pure tests
Augie Fackler <augie@google.com>
parents: 35792
diff changeset
    13
    ),
35094
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    14
    # capabilities sent through http
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    15
    (br'bundlecaps=HG20%2Cbundle2%3DHG20%250A'
35268
ad5f2b923b0d push: include a 'check:bookmarks' part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35243
diff changeset
    16
     br'bookmarks%250A'
35094
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    17
     br'changegroup%253D01%252C02%250A'
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    18
     br'digests%253Dmd5%252Csha1%252Csha512%250A'
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    19
     br'error%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250A'
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    20
     br'hgtagsfnodes%250A'
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    21
     br'listkeys%250A'
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    22
     br'phases%253Dheads%250A'
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    23
     br'pushkey%250A'
35792
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    24
     br'remote-changegroup%253Dhttp%252Chttps%250A'
36974
2090044a288d revbranchcache: advertise and use 'rbc' exchange capability
Boris Feld <boris.feld@octobus.net>
parents: 36930
diff changeset
    25
     br'rev-branch-cache%250A'
35792
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    26
     br'stream%253Dv2',
35094
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    27
     # (the replacement patterns)
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    28
     br'$USUAL_BUNDLE_CAPS$'
b4767ae63b32 test-pattern: register current the bundlecaps string
Boris Feld <boris.feld@octobus.net>
parents: 35093
diff changeset
    29
    ),
35792
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    30
    (br'bundlecaps=HG20%2Cbundle2%3DHG20%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    31
     br'bookmarks%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    32
     br'changegroup%253D01%252C02%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    33
     br'digests%253Dmd5%252Csha1%252Csha512%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    34
     br'error%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    35
     br'hgtagsfnodes%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    36
     br'listkeys%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    37
     br'phases%253Dheads%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    38
     br'pushkey%250A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    39
     br'remote-changegroup%253Dhttp%252Chttps',
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    40
     # (the replacement patterns)
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    41
     br'$USUAL_BUNDLE_CAPS_SERVER$'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    42
     ),
35095
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    43
    # bundle2 capabilities sent through ssh
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    44
    (br'bundle2=HG20%0A'
35268
ad5f2b923b0d push: include a 'check:bookmarks' part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35243
diff changeset
    45
     br'bookmarks%0A'
35095
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    46
     br'changegroup%3D01%2C02%0A'
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    47
     br'digests%3Dmd5%2Csha1%2Csha512%0A'
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    48
     br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A'
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    49
     br'hgtagsfnodes%0A'
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    50
     br'listkeys%0A'
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    51
     br'phases%3Dheads%0A'
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    52
     br'pushkey%0A'
35792
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    53
     br'remote-changegroup%3Dhttp%2Chttps%0A'
36974
2090044a288d revbranchcache: advertise and use 'rbc' exchange capability
Boris Feld <boris.feld@octobus.net>
parents: 36930
diff changeset
    54
     br'rev-branch-cache%0A'
35792
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    55
     br'stream%3Dv2',
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    56
     # (replacement patterns)
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    57
     br'$USUAL_BUNDLE2_CAPS$'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    58
    ),
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    59
    # bundle2 capabilities advertised by the server
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    60
    (br'bundle2=HG20%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    61
     br'bookmarks%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    62
     br'changegroup%3D01%2C02%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    63
     br'digests%3Dmd5%2Csha1%2Csha512%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    64
     br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    65
     br'hgtagsfnodes%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    66
     br'listkeys%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    67
     br'phases%3Dheads%0A'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    68
     br'pushkey%0A'
36974
2090044a288d revbranchcache: advertise and use 'rbc' exchange capability
Boris Feld <boris.feld@octobus.net>
parents: 36930
diff changeset
    69
     br'remote-changegroup%3Dhttp%2Chttps%0A'
2090044a288d revbranchcache: advertise and use 'rbc' exchange capability
Boris Feld <boris.feld@octobus.net>
parents: 36930
diff changeset
    70
     br'rev-branch-cache',
35095
c4ec72a10798 test-pattern: register the current the bundle2 capabilities string
Boris Feld <boris.feld@octobus.net>
parents: 35094
diff changeset
    71
     # (replacement patterns)
35792
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    72
     br'$USUAL_BUNDLE2_CAPS_SERVER$'
1d118f9f4f57 bundle2: always advertise client support for stream parts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35453
diff changeset
    73
     ),
38728
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    74
    (
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    75
     br'bundle2=HG20%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    76
     br'bookmarks%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    77
     br'changegroup%3D01%2C02%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    78
     br'digests%3Dmd5%2Csha1%2Csha512%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    79
     br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    80
     br'hgtagsfnodes%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    81
     br'listkeys%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    82
     br'pushkey%0A'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    83
     br'remote-changegroup%3Dhttp%2Chttps%0A'
39738
4bd6e444c76f bundle2: make server.bundle2.stream default to True
Anton Shestakov <av6@dwimlabs.net>
parents: 38728
diff changeset
    84
     br'rev-branch-cache%0A'
4bd6e444c76f bundle2: make server.bundle2.stream default to True
Anton Shestakov <av6@dwimlabs.net>
parents: 38728
diff changeset
    85
     br'stream%3Dv2',
38728
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    86
     # (replacement patterns)
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    87
     br'$USUAL_BUNDLE2_CAPS_NO_PHASES$'
88be288e8ac1 tests: refactor common bundle2 capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37477
diff changeset
    88
    ),
37477
28e8c5949109 tests: add a substitution pattern for HTTP error log dates
Matt Harbison <matt_harbison@yahoo.com>
parents: 37011
diff changeset
    89
    # HTTP access log dates
36416
003ae586a02e tests: add HTTP POST and PUT support to the $LOGDATE$ substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35806
diff changeset
    90
    (br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "(GET|PUT|POST)',
003ae586a02e tests: add HTTP POST and PUT support to the $LOGDATE$ substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35806
diff changeset
    91
     lambda m: br' - - [$LOGDATE$] "' + m.group(1)
35096
7f0c9e28a816 test-pattern: substitute the HTTP log timestamp too
Boris Feld <boris.feld@octobus.net>
parents: 35095
diff changeset
    92
    ),
37477
28e8c5949109 tests: add a substitution pattern for HTTP error log dates
Matt Harbison <matt_harbison@yahoo.com>
parents: 37011
diff changeset
    93
    # HTTP error log dates
28e8c5949109 tests: add a substitution pattern for HTTP error log dates
Matt Harbison <matt_harbison@yahoo.com>
parents: 37011
diff changeset
    94
    (br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] (HG error:|Exception)',
28e8c5949109 tests: add a substitution pattern for HTTP error log dates
Matt Harbison <matt_harbison@yahoo.com>
parents: 37011
diff changeset
    95
     lambda m: br' - - [$ERRDATE$] ' + m.group(1)
28e8c5949109 tests: add a substitution pattern for HTTP error log dates
Matt Harbison <matt_harbison@yahoo.com>
parents: 37011
diff changeset
    96
    ),
36930
03368431f014 tests: add a substitution pattern for dates in HTTP headers and LFS payload
Matt Harbison <matt_harbison@yahoo.com>
parents: 36416
diff changeset
    97
    # HTTP header dates- RFC 1123
37011
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36974
diff changeset
    98
    (br'([Dd]ate): [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT',
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36974
diff changeset
    99
     lambda m: br'%s: $HTTP_DATE$' % m.group(1)
36930
03368431f014 tests: add a substitution pattern for dates in HTTP headers and LFS payload
Matt Harbison <matt_harbison@yahoo.com>
parents: 36416
diff changeset
   100
    ),
03368431f014 tests: add a substitution pattern for dates in HTTP headers and LFS payload
Matt Harbison <matt_harbison@yahoo.com>
parents: 36416
diff changeset
   101
    # LFS expiration value
03368431f014 tests: add a substitution pattern for dates in HTTP headers and LFS payload
Matt Harbison <matt_harbison@yahoo.com>
parents: 36416
diff changeset
   102
    (br'"expires_at": "\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ"',
03368431f014 tests: add a substitution pattern for dates in HTTP headers and LFS payload
Matt Harbison <matt_harbison@yahoo.com>
parents: 36416
diff changeset
   103
     br'"expires_at": "$ISO_8601_DATE_TIME$"'
03368431f014 tests: add a substitution pattern for dates in HTTP headers and LFS payload
Matt Harbison <matt_harbison@yahoo.com>
parents: 36416
diff changeset
   104
    ),
35450
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   105
    # Windows has an extra '/' in the following lines that get globbed away:
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   106
    #   pushing to file:/*/$TESTTMP/r2 (glob)
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   107
    #   comparing with file:/*/$TESTTMP/r2 (glob)
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   108
    #   sub/maybelarge.dat: largefile 34..9c not available from
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   109
    #       file:/*/$TESTTMP/largefiles-repo (glob)
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   110
    (br'(.*file:/)/?(/\$TESTTMP.*)',
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   111
     lambda m: m.group(1) + b'*' + m.group(2) + b' (glob)'
991e4404e910 tests: convert the 'file://\$TESTTMP' rule to an automatic substitution
Matt Harbison <matt_harbison@yahoo.com>
parents: 35268
diff changeset
   112
    ),
35093
3abdd7da33bd test-pattern: substitute common compression list
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   113
]
35239
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   114
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   115
# Various platform error strings, keyed on a common replacement string
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   116
_errors = {
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   117
    br'$ENOENT$': (
42351
c7652f7440d9 rust-filepatterns: call new Rust implementations from Python
Raphaël Gomès <rgomes@octobus.net>
parents: 40899
diff changeset
   118
        # IOError in Python does not have the same error message
c7652f7440d9 rust-filepatterns: call new Rust implementations from Python
Raphaël Gomès <rgomes@octobus.net>
parents: 40899
diff changeset
   119
        # than in Rust, and automatic conversion is not possible
c7652f7440d9 rust-filepatterns: call new Rust implementations from Python
Raphaël Gomès <rgomes@octobus.net>
parents: 40899
diff changeset
   120
        # because of module member privacy.
c7652f7440d9 rust-filepatterns: call new Rust implementations from Python
Raphaël Gomès <rgomes@octobus.net>
parents: 40899
diff changeset
   121
        br'No such file or directory \(os error 2\)',
c7652f7440d9 rust-filepatterns: call new Rust implementations from Python
Raphaël Gomès <rgomes@octobus.net>
parents: 40899
diff changeset
   122
35239
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   123
        # strerror()
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   124
        br'No such file or directory',
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   125
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   126
        # FormatMessage(ERROR_FILE_NOT_FOUND)
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   127
        br'The system cannot find the file specified',
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   128
    ),
35240
b33d4cf38666 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35239
diff changeset
   129
    br'$ENOTDIR$': (
b33d4cf38666 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35239
diff changeset
   130
        # strerror()
b33d4cf38666 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35239
diff changeset
   131
        br'Not a directory',
b33d4cf38666 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35239
diff changeset
   132
b33d4cf38666 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35239
diff changeset
   133
        # FormatMessage(ERROR_PATH_NOT_FOUND)
b33d4cf38666 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35239
diff changeset
   134
        br'The system cannot find the path specified',
b33d4cf38666 tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35239
diff changeset
   135
    ),
35241
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35240
diff changeset
   136
    br'$ECONNRESET$': (
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35240
diff changeset
   137
        # strerror()
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35240
diff changeset
   138
        br'Connection reset by peer',
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35240
diff changeset
   139
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35240
diff changeset
   140
        # FormatMessage(WSAECONNRESET)
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35240
diff changeset
   141
        br'An existing connection was forcibly closed by the remote host',
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35240
diff changeset
   142
    ),
35242
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   143
    br'$EADDRINUSE$': (
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   144
        # strerror()
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   145
        br'Address already in use',
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   146
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   147
        # FormatMessage(WSAEADDRINUSE)
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   148
        br'Only one usage of each socket address'
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   149
        br' \(protocol/network address/port\) is normally permitted',
1b22d325089c tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35241
diff changeset
   150
    ),
40899
8695fbe17f7c tests: update network related errors for Debian 9
Boris Feld <boris.feld@octobus.net>
parents: 39738
diff changeset
   151
    br'$EADDRNOTAVAIL$': (
8695fbe17f7c tests: update network related errors for Debian 9
Boris Feld <boris.feld@octobus.net>
parents: 39738
diff changeset
   152
        # strerror()
8695fbe17f7c tests: update network related errors for Debian 9
Boris Feld <boris.feld@octobus.net>
parents: 39738
diff changeset
   153
        br'Cannot assign requested address',
8695fbe17f7c tests: update network related errors for Debian 9
Boris Feld <boris.feld@octobus.net>
parents: 39738
diff changeset
   154
8695fbe17f7c tests: update network related errors for Debian 9
Boris Feld <boris.feld@octobus.net>
parents: 39738
diff changeset
   155
        # FormatMessage(WSAEADDRNOTAVAIL)
8695fbe17f7c tests: update network related errors for Debian 9
Boris Feld <boris.feld@octobus.net>
parents: 39738
diff changeset
   156
    )
35239
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   157
}
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   158
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   159
for replace, msgs in _errors.items():
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35096
diff changeset
   160
    substitutions.extend((m, replace) for m in msgs)
35453
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   161
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   162
# Output lines on Windows that can be autocorrected for '\' vs '/' path
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   163
# differences.
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   164
_winpathfixes = [
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   165
    # cloning subrepo s\ss from $TESTTMP/t/s/ss
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   166
    # cloning subrepo foo\bar from http://localhost:$HGPORT/foo/bar
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   167
    br'(?m)^cloning subrepo \S+\\.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   168
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   169
    # pulling from $TESTTMP\issue1852a
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   170
    br'(?m)^pulling from \$TESTTMP\\.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   171
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   172
    # pushing to $TESTTMP\a
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   173
    br'(?m)^pushing to \$TESTTMP\\.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   174
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   175
    # pushing subrepo s\ss to $TESTTMP/t/s/ss
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   176
    br'(?m)^pushing subrepo \S+\\\S+ to.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   177
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   178
    # moving d1\d11\a1 to d3/d11/a1
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   179
    br'(?m)^moving \S+\\.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   180
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   181
    # d1\a: not recording move - dummy does not exist
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   182
    br'\S+\\\S+: not recording move .+',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   183
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   184
    # reverting s\a
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   185
    br'(?m)^reverting (?!subrepo ).*\\.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   186
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   187
    # saved backup bundle to
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   188
    #     $TESTTMP\test\.hg\strip-backup/443431ffac4f-2fc5398a-backup.hg
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   189
    br'(?m)^saved backup bundle to \$TESTTMP.*\.hg',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   190
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   191
    # no changes made to subrepo s\ss since last push to ../tcc/s/ss
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   192
    br'(?m)^no changes made to subrepo \S+\\\S+ since.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   193
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   194
    # changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   195
    #     $TESTTMP\largefiles-repo-hg\.hg\largefiles\76..38
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   196
    br'(?m)^changeset .* references (corrupted|missing) \$TESTTMP\\.*',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   197
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   198
    # stuff/maybelarge.dat: largefile 76..38 not available from
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   199
    #     file:/*/$TESTTMP\largefiles-repo (glob)
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   200
    br'.*: largefile \S+ not available from file:/\*/.+',
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   201
]
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   202
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   203
if os.name == 'nt':
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   204
    substitutions.extend([(s, lambda match: match.group().replace(b'\\', b'/'))
24528dba0e64 run-tests: add substitution patterns for common '\' path output on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35450
diff changeset
   205
                          for s in _winpathfixes])