tests/test-mq-eol.t
author Augie Fackler <raf@durin42.com>
Sat, 07 Jun 2014 15:14:36 -0400
branchstable
changeset 21825 3666331164bb
parent 13100 66d7a1250c9b
child 22545 6a2cfa61acb0
permissions -rw-r--r--
cmdutil: add copy-filtering support to duplicatecopies In order to fix issue 4192 we need to be able to skip some copies while doing duplicatecopies.
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
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
     5
  $ echo "[extensions]" >> $HGRCPATH
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
     6
  $ echo "mq=" >> $HGRCPATH
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
     7
  $ echo "[diff]" >> $HGRCPATH
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
     8
  $ echo "nodates=1" >> $HGRCPATH
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    10
  $ cat > makepatch.py <<EOF
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    11
  > f = file('eol.diff', 'wb')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    12
  > w = f.write
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    13
  > w('test message\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    14
  > w('diff --git a/a b/a\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    15
  > w('--- a/a\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    16
  > w('+++ b/a\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    17
  > w('@@ -1,5 +1,5 @@\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    18
  > w(' a\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    19
  > w('-b\r\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    20
  > w('+y\r\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    21
  > w(' c\r\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    22
  > w(' d\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    23
  > w('-e\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    24
  > w('\ No newline at end of file\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    25
  > w('+z\r\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    26
  > w('\ No newline at end of file\r\n')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    27
  > EOF
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    29
  $ cat > cateol.py <<EOF
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    30
  > import sys
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    31
  > for line in file(sys.argv[1], 'rb'):
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    32
  >     line = line.replace('\r', '<CR>')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    33
  >     line = line.replace('\n', '<LF>')
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    34
  >     print line
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    35
  > EOF
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    36
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    37
  $ hg init repo
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    38
  $ cd repo
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    39
  $ echo '\.diff' > .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    40
  $ echo '\.rej' >> .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    41
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
Test different --eol values
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    44
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    45
  $ python -c 'file("a", "wb").write("a\nb\nc\nd\ne")'
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    46
  $ hg ci -Am adda
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    47
  adding .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    48
  adding a
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    49
  $ python ../makepatch.py
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    50
  $ hg qimport eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    51
  adding eol.diff to series file
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    52
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    53
should fail in strict mode
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    54
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    55
  $ hg qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    56
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    57
  patching file a
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    58
  Hunk #1 FAILED at 0
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    59
  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
    60
  patch failed, unable to continue (try -v)
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    61
  patch failed, rejects left in working dir
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    62
  errors during apply, please fix and refresh eol.diff
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11895
diff changeset
    63
  [2]
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    64
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    65
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    66
  patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    67
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    68
invalid eol
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    69
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    70
  $ hg --config patch.eol='LFCR' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    71
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    72
  patch failed, unable to continue (try -v)
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    73
  patch failed, rejects left in working dir
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    74
  errors during apply, please fix and refresh eol.diff
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11895
diff changeset
    75
  [2]
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    76
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    77
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    78
  patch queue now empty
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    79
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    80
force LF
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    81
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    82
  $ hg --config patch.eol='CRLF' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    83
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    84
  now at: eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    85
  $ hg qrefresh
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    86
  $ python ../cateol.py .hg/patches/eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    87
  test message<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    88
  <LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    89
  diff -r 0d0bf99a8b7a a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    90
  --- a/a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    91
  +++ b/a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    92
  @@ -1,5 +1,5 @@<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    93
  -a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    94
  -b<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    95
  -c<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    96
  -d<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    97
  -e<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    98
  \ No newline at end of file<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
    99
  +a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   100
  +y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   101
  +c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   102
  +d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   103
  +z<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   104
  \ No newline at end of file<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   105
  $ python ../cateol.py a
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   106
  a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   107
  y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   108
  c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   109
  d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   110
  z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   111
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   112
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   113
  patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   114
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   115
push again forcing LF and compare revisions
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   116
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   117
  $ hg --config patch.eol='CRLF' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   118
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   119
  now at: eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   120
  $ python ../cateol.py a
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   121
  a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   122
  y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   123
  c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   124
  d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   125
  z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   126
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   127
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   128
  patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   129
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   130
push again without LF and compare revisions
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   131
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   132
  $ hg qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   133
  applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   134
  now at: eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   135
  $ python ../cateol.py a
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   136
  a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   137
  y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   138
  c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   139
  d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   140
  z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   141
  $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   142
  popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
   143
  patch queue now empty
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   144
  $ cd ..
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   145
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   146
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   147
Test .rej file EOL are left unchanged
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   148
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   149
  $ hg init testeol
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   150
  $ cd testeol
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   151
  $ python -c "file('a', 'wb').write('1\r\n2\r\n3\r\n4')"
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   152
  $ hg ci -Am adda
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   153
  adding a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   154
  $ python -c "file('a', 'wb').write('1\r\n2\r\n33\r\n4')"
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   155
  $ hg qnew patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   156
  $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   157
  popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   158
  patch queue now empty
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   159
  $ python -c "file('a', 'wb').write('1\r\n22\r\n33\r\n4')"
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   160
  $ hg ci -m changea
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   161
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   162
  $ hg --config 'patch.eol=LF' qpush
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   163
  applying patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   164
  patching file a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   165
  Hunk #1 FAILED at 0
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   166
  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
   167
  patch failed, unable to continue (try -v)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   168
  patch failed, rejects left in working dir
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   169
  errors during apply, please fix and refresh patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   170
  [2]
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   171
  $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   172
  popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   173
  patch queue now empty
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   174
  $ cat a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   175
  --- a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   176
  +++ a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   177
  @@ -1,4 +1,4 @@
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   178
   1\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   179
   2\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   180
  -3\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   181
  +33\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   182
   4
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   183
  \ No newline at end of file
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   184
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   185
  $ hg --config 'patch.eol=auto' qpush
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   186
  applying patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   187
  patching file a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   188
  Hunk #1 FAILED at 0
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   189
  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
   190
  patch failed, unable to continue (try -v)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   191
  patch failed, rejects left in working dir
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   192
  errors during apply, please fix and refresh patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   193
  [2]
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   194
  $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   195
  popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   196
  patch queue now empty
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   197
  $ cat a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   198
  --- a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   199
  +++ a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   200
  @@ -1,4 +1,4 @@
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   201
   1\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   202
   2\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   203
  -3\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   204
  +33\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   205
   4
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   206
  \ No newline at end of file
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
   207
  $ cd ..