tests/test-mq-eol.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 16 Apr 2019 17:26:38 +0200
changeset 42159 4f9a89837f07
parent 41707 140b542b0e59
permissions -rw-r--r--
setdiscovery: stop limiting the number of local head we initially send In our testing this limitation provides now real gain and instead triggers pathological discovery timing for some repository with many heads. See inline documentation for details. Some timing below: Mozilla try repository, (~1M revs, ~35K heads), discovery between 2 clones with 100 head missing on each side before: ! wall 1.492111 comb 1.490000 user 1.450000 sys 0.040000 (best of 20) ! wall 1.813992 comb 1.820000 user 1.700000 sys 0.120000 (max of 20) ! wall 1.574326 comb 1.573500 user 1.522000 sys 0.051500 (avg of 20) ! wall 1.572583 comb 1.570000 user 1.520000 sys 0.050000 (median of 20) after: ! wall 1.147834 comb 1.150000 user 1.090000 sys 0.060000 (best of 20) ! wall 1.449144 comb 1.450000 user 1.330000 sys 0.120000 (max of 20) ! wall 1.204618 comb 1.202500 user 1.146500 sys 0.056000 (avg of 20) ! wall 1.194407 comb 1.190000 user 1.140000 sys 0.050000 (median of 20) pypy (~100 heads, 317 heads) discovery between clones with only 42 common heads before: ! wall 0.031653 comb 0.030000 user 0.030000 sys 0.000000 (best of 25) ! wall 0.055719 comb 0.050000 user 0.040000 sys 0.010000 (max of 25) ! wall 0.038939 comb 0.039600 user 0.038400 sys 0.001200 (avg of 25) ! wall 0.038660 comb 0.050000 user 0.040000 sys 0.010000 (median of 25) after: ! wall 0.018754 comb 0.020000 user 0.020000 sys 0.000000 (best of 49) ! wall 0.034505 comb 0.040000 user 0.030000 sys 0.010000 (max of 49) ! wall 0.019631 comb 0.019796 user 0.018367 sys 0.001429 (avg of 49) ! wall 0.019132 comb 0.020000 user 0.020000 sys 0.000000 (median of 49) Private repository (~1M revs, ~3K heads), discovery from a strip subset, about 100 changesets to be pulled. before: ! wall 1.837729 comb 1.840000 user 1.790000 sys 0.050000 (best of 20) ! wall 2.203468 comb 2.200000 user 2.100000 sys 0.100000 (max of 20) ! wall 2.049355 comb 2.048500 user 2.002500 sys 0.046000 (avg of 20) ! wall 2.035315 comb 2.040000 user 2.000000 sys 0.040000 (median of 20) after: ! wall 0.136598 comb 0.130000 user 0.110000 sys 0.020000 (best of 20) ! wall 0.330519 comb 0.330000 user 0.260000 sys 0.070000 (max of 20) ! wall 0.157254 comb 0.155500 user 0.123000 sys 0.032500 (avg of 20) ! wall 0.149870 comb 0.140000 user 0.110000 sys 0.030000 (median of 20) Same private repo, discovery between two clone with 500 different heads on each side: before: ! wall 2.372919 comb 2.370000 user 2.320000 sys 0.050000 (best of 20) ! wall 2.622422 comb 2.610000 user 2.510000 sys 0.100000 (max of 20) ! wall 2.450135 comb 2.450000 user 2.402000 sys 0.048000 (avg of 20) ! wall 2.443896 comb 2.450000 user 2.410000 sys 0.040000 (median of 20) after: ! wall 0.625497 comb 0.620000 user 0.570000 sys 0.050000 (best of 20) ! wall 0.834723 comb 0.820000 user 0.730000 sys 0.090000 (max of 20) ! wall 0.675725 comb 0.675500 user 0.628000 sys 0.047500 (avg of 20) ! wall 0.671614 comb 0.680000 user 0.640000 sys 0.040000 (median of 20)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
     1
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
     2
Test interactions between mq and patch.eol
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
     3
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
23172
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     5
  $ cat <<EOF >> $HGRCPATH
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     6
  > [extensions]
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     7
  > mq =
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     8
  > [diff]
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
     9
  > nodates = 1
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 22947
diff changeset
    10
  > EOF
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    12
  $ cat > makepatch.py <<EOF
35945
1dbd8a62b581 py3: use open() instead of file()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33721
diff changeset
    13
  > f = open('eol.diff', 'wb')
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    14
  > w = f.write
36283
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    15
  > w(b'test message\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    16
  > w(b'diff --git a/a b/a\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    17
  > w(b'--- a/a\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    18
  > w(b'+++ b/a\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    19
  > w(b'@@ -1,5 +1,5 @@\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    20
  > w(b' a\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    21
  > w(b'-b\r\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    22
  > w(b'+y\r\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    23
  > w(b' c\r\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    24
  > w(b' d\n')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    25
  > w(b'-e\n')
41707
140b542b0e59 tests: double escape \ in test-import-eol.t and test-mq-eol.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41550
diff changeset
    26
  > w(b'\\\\ No newline at end of file\n')
36283
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    27
  > w(b'+z\r\n')
41707
140b542b0e59 tests: double escape \ in test-import-eol.t and test-mq-eol.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41550
diff changeset
    28
  > w(b'\\\\ No newline at end of file\r\n')
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    29
  > EOF
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    31
  $ cat > cateol.py <<EOF
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    32
  > import sys
41329
84707d9e77a0 tests: write directly to stdout to avoid b'' prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    33
  > try:
84707d9e77a0 tests: write directly to stdout to avoid b'' prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    34
  >     stdout = sys.stdout.buffer
84707d9e77a0 tests: write directly to stdout to avoid b'' prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    35
  > except AttributeError:
84707d9e77a0 tests: write directly to stdout to avoid b'' prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    36
  >     stdout = sys.stdout
35945
1dbd8a62b581 py3: use open() instead of file()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33721
diff changeset
    37
  > for line in open(sys.argv[1], 'rb'):
36283
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    38
  >     line = line.replace(b'\r', b'<CR>')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
    39
  >     line = line.replace(b'\n', b'<LF>')
41329
84707d9e77a0 tests: write directly to stdout to avoid b'' prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    40
  >     stdout.write(line + b'\n')
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    41
  > EOF
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    42
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    43
  $ hg init repo
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    44
  $ cd repo
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    45
  $ echo '\.diff' > .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    46
  $ echo '\.rej' >> .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    47
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    48
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    49
Test different --eol values
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    50
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
    51
  $ "$PYTHON" -c 'open("a", "wb").write(b"a\nb\nc\nd\ne")'
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    52
  $ hg ci -Am adda
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    53
  adding .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    54
  adding a
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
    55
  $ "$PYTHON" ../makepatch.py
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    56
  $ hg qimport eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    57
  adding eol.diff to series file
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    58
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    59
should fail in strict mode
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    60
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    61
  $ hg qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    62
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    63
  patching file a
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    64
  Hunk #1 FAILED at 0
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    65
  1 out of 1 hunks FAILED -- saving rejects to file a.rej
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    66
  patch failed, unable to continue (try -v)
24365
f1eaf03dd608 commands: say "working directory" in full spelling
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    67
  patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
    68
  errors during apply, please fix and qrefresh eol.diff
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11895
diff changeset
    69
  [2]
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    70
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    71
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    72
  patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    73
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    74
invalid eol
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    75
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    76
  $ hg --config patch.eol='LFCR' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    77
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    78
  patch failed, unable to continue (try -v)
24365
f1eaf03dd608 commands: say "working directory" in full spelling
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
    79
  patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
    80
  errors during apply, please fix and qrefresh eol.diff
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11895
diff changeset
    81
  [2]
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    82
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    83
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    84
  patch queue now empty
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    85
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    86
force LF
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    87
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    88
  $ hg --config patch.eol='CRLF' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    89
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    90
  now at: eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    91
  $ hg qrefresh
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
    92
  $ "$PYTHON" ../cateol.py .hg/patches/eol.diff
22545
6a2cfa61acb0 mq: upgrade non-plain patches to HG format when setting parent in patchheader
Mads Kiilerich <madski@unity3d.com>
parents: 13100
diff changeset
    93
  # HG changeset patch<LF>
6a2cfa61acb0 mq: upgrade non-plain patches to HG format when setting parent in patchheader
Mads Kiilerich <madski@unity3d.com>
parents: 13100
diff changeset
    94
  # Parent  0d0bf99a8b7a3842c6f8ef09e34f69156c4bd9d0<LF>
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    95
  test message<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    96
  <LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    97
  diff -r 0d0bf99a8b7a a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    98
  --- a/a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    99
  +++ b/a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   100
  @@ -1,5 +1,5 @@<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   101
  -a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   102
  -b<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   103
  -c<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   104
  -d<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   105
  -e<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   106
  \ No newline at end of file<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   107
  +a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   108
  +y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   109
  +c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   110
  +d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   111
  +z<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   112
  \ No newline at end of file<LF>
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
   113
  $ "$PYTHON" ../cateol.py a
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   114
  a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   115
  y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   116
  c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   117
  d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   118
  z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   119
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   120
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   121
  patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   122
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   123
push again forcing LF and compare revisions
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   124
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   125
  $ hg --config patch.eol='CRLF' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   126
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   127
  now at: eol.diff
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
   128
  $ "$PYTHON" ../cateol.py a
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   129
  a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   130
  y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   131
  c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   132
  d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   133
  z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   134
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   135
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   136
  patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   137
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   138
push again without LF and compare revisions
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   139
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   140
  $ hg qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   141
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   142
  now at: eol.diff
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
   143
  $ "$PYTHON" ../cateol.py a
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   144
  a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   145
  y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   146
  c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   147
  d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   148
  z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   149
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   150
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   151
  patch queue now empty
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   152
  $ cd ..
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   153
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   154
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   155
Test .rej file EOL are left unchanged
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   156
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   157
  $ hg init testeol
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   158
  $ cd testeol
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
   159
  $ "$PYTHON" -c "open('a', 'wb').write(b'1\r\n2\r\n3\r\n4')"
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   160
  $ hg ci -Am adda
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   161
  adding a
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
   162
  $ "$PYTHON" -c "open('a', 'wb').write(b'1\r\n2\r\n33\r\n4')"
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   163
  $ hg qnew patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   164
  $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   165
  popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   166
  patch queue now empty
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36283
diff changeset
   167
  $ "$PYTHON" -c "open('a', 'wb').write(b'1\r\n22\r\n33\r\n4')"
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   168
  $ hg ci -m changea
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   169
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   170
  $ hg --config 'patch.eol=LF' qpush
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   171
  applying patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   172
  patching file a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   173
  Hunk #1 FAILED at 0
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   174
  1 out of 1 hunks FAILED -- saving rejects to file a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   175
  patch failed, unable to continue (try -v)
24365
f1eaf03dd608 commands: say "working directory" in full spelling
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
   176
  patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
   177
  errors during apply, please fix and qrefresh patch1
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   178
  [2]
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   179
  $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   180
  popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   181
  patch queue now empty
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   182
  $ cat a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   183
  --- a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   184
  +++ a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   185
  @@ -1,4 +1,4 @@
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   186
   1\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   187
   2\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   188
  -3\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   189
  +33\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   190
   4
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   191
  \ No newline at end of file
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   192
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   193
  $ hg --config 'patch.eol=auto' qpush
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   194
  applying patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   195
  patching file a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   196
  Hunk #1 FAILED at 0
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   197
  1 out of 1 hunks FAILED -- saving rejects to file a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   198
  patch failed, unable to continue (try -v)
24365
f1eaf03dd608 commands: say "working directory" in full spelling
Yuya Nishihara <yuya@tcha.org>
parents: 23172
diff changeset
   199
  patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
   200
  errors during apply, please fix and qrefresh patch1
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   201
  [2]
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   202
  $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   203
  popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   204
  patch queue now empty
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   205
  $ cat a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   206
  --- a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   207
  +++ a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   208
  @@ -1,4 +1,4 @@
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   209
   1\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   210
   2\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   211
  -3\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   212
  +33\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   213
   4
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   214
  \ No newline at end of file
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   215
  $ cd ..