annotate tests/test-mq-eol.t @ 39548:7ce9dea3a14a

localrepo: move repo creation logic out of localrepository.__init__ (API) It has long bothered me that local repository creation is handled as part of localrepository.__init__. Upcoming changes I want to make around how repositories are initialized and instantiated will make the continued existence of repository creation code in localrepository.__init__ even more awkward. localrepository instances are almost never constructed directly: instead, callers are supposed to go through hg.repository() to obtain a handle on a repository. And hg.repository() calls localrepo.instance() to return a new repo instance. This commit teaches localrepo.instance() to handle the create=True logic. Most of the code for repo construction has been moved to a standalone function. This allows extensions to monkeypatch the function to further customize freshly-created repositories. A few calls to localrepo.localrepository.__init__ that were passing create=True were converted to call localrepo.instance(). .. api:: local repo creation moved out of constructor ``localrepo.localrepository.__init__`` no longer accepts a ``create`` argument to create a new repository. New repository creation is now performed as part of ``localrepo.instance()`` and the bulk of the work is performed by ``localrepo.createrepository()``. Differential Revision: https://phab.mercurial-scm.org/D4534
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 11 Sep 2018 13:46:59 -0700
parents a67b144ef74f
children 5abc47d4ca6b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
26 > w(b'\ No newline at end of file\n')
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')
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
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
35945
1dbd8a62b581 py3: use open() instead of file()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33721
diff changeset
33 > 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
34 > 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
35 > line = line.replace(b'\n', b'<LF>')
33721
24849d53697d tests: clean up many print statements to be print functions instead
Augie Fackler <augie@google.com>
parents: 32940
diff changeset
36 > print(line)
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
37 > EOF
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
38
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
39 $ hg init repo
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
40 $ cd repo
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
41 $ echo '\.diff' > .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
42 $ echo '\.rej' >> .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
43
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 Test different --eol values
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
46
36283
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
47 $ $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
48 $ hg ci -Am adda
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
49 adding .hgignore
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
50 adding a
32940
75be14993fda cleanup: use $PYTHON to run python in many more tests
Augie Fackler <augie@google.com>
parents: 26780
diff changeset
51 $ $PYTHON ../makepatch.py
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
52 $ hg qimport eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
53 adding eol.diff to series file
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 should fail in strict mode
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
56
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
57 $ hg qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
58 applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
59 patching file a
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
60 Hunk #1 FAILED at 0
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
61 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
62 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
63 patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
64 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
65 [2]
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
66 $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
67 popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
68 patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
69
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
70 invalid eol
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
71
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
72 $ hg --config patch.eol='LFCR' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
73 applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
74 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
75 patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
76 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
77 [2]
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
78 $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
79 popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
80 patch queue now empty
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 force LF
8811
8b35b08724eb Make mq, record and transplant honor patch.eol
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
83
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
84 $ hg --config patch.eol='CRLF' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
85 applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
86 now at: eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
87 $ hg qrefresh
32940
75be14993fda cleanup: use $PYTHON to run python in many more tests
Augie Fackler <augie@google.com>
parents: 26780
diff changeset
88 $ $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
89 # 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
90 # Parent 0d0bf99a8b7a3842c6f8ef09e34f69156c4bd9d0<LF>
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
91 test message<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
92 <LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
93 diff -r 0d0bf99a8b7a a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
94 --- a/a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
95 +++ b/a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
96 @@ -1,5 +1,5 @@<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
97 -a<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
98 -b<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
99 -c<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
100 -d<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
101 -e<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
102 \ No newline at end of file<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
103 +a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
104 +y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
105 +c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
106 +d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
107 +z<LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
108 \ No newline at end of file<LF>
32940
75be14993fda cleanup: use $PYTHON to run python in many more tests
Augie Fackler <augie@google.com>
parents: 26780
diff changeset
109 $ $PYTHON ../cateol.py a
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
110 a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
111 y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
112 c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
113 d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
114 z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
115 $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
116 popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
117 patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
118
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
119 push again forcing LF and compare revisions
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
120
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
121 $ hg --config patch.eol='CRLF' qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
122 applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
123 now at: eol.diff
32940
75be14993fda cleanup: use $PYTHON to run python in many more tests
Augie Fackler <augie@google.com>
parents: 26780
diff changeset
124 $ $PYTHON ../cateol.py a
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
125 a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
126 y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
127 c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
128 d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
129 z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
130 $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
131 popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
132 patch queue now empty
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
133
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
134 push again without LF and compare revisions
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
135
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
136 $ hg qpush
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
137 applying eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
138 now at: eol.diff
32940
75be14993fda cleanup: use $PYTHON to run python in many more tests
Augie Fackler <augie@google.com>
parents: 26780
diff changeset
139 $ $PYTHON ../cateol.py a
11895
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
140 a<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
141 y<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
142 c<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
143 d<CR><LF>
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
144 z
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
145 $ hg qpop
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
146 popping eol.diff
78e3a70c4445 tests: unify test-mq-eol
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10190
diff changeset
147 patch queue now empty
13100
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
148 $ cd ..
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
149
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
150
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
151 Test .rej file EOL are left unchanged
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
152
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
153 $ hg init testeol
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
154 $ cd testeol
36283
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
155 $ $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
156 $ hg ci -Am adda
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
157 adding a
36283
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
158 $ $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
159 $ hg qnew patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
160 $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
161 popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
162 patch queue now empty
36283
a67b144ef74f py3: add b'' prefixes in test-mq-eol.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35945
diff changeset
163 $ $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
164 $ hg ci -m changea
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
165
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
166 $ hg --config 'patch.eol=LF' qpush
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
167 applying patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
168 patching file a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
169 Hunk #1 FAILED at 0
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
170 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
171 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
172 patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
173 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
174 [2]
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
175 $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
176 popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
177 patch queue now empty
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
178 $ cat a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
179 --- a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
180 +++ a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
181 @@ -1,4 +1,4 @@
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
182 1\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
183 2\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
184 -3\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
185 +33\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
186 4
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
187 \ No newline at end of file
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
188
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
189 $ hg --config 'patch.eol=auto' qpush
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
190 applying patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
191 patching file a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
192 Hunk #1 FAILED at 0
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
193 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
194 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
195 patch failed, rejects left in working directory
26780
bbf544b5f2e9 mq: consistently use qrefresh
timeless@mozdev.org
parents: 24365
diff changeset
196 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
197 [2]
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
198 $ hg qpop
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
199 popping patch1
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
200 patch queue now empty
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
201 $ cat a.rej
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
202 --- a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
203 +++ a
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
204 @@ -1,4 +1,4 @@
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
205 1\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
206 2\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
207 -3\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
208 +33\r (esc)
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
209 4
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
210 \ No newline at end of file
66d7a1250c9b patch: write .rej files without rewriting EOLs
Patrick Mezard <pmezard@gmail.com>
parents: 12316
diff changeset
211 $ cd ..