annotate tests/test-mq-qnew.t @ 42044:bb271ec2fbfb

compression: introduce a `storage.revlog.zstd.level` configuration This option control the zstd compression level used when compressing revlog chunk. The usage of zstd for revlog compression has not graduated from experimental yet, but we intend to fix that soon. The option name for the compression level is more straight forward to pick, so this changesets comes first. Having a dedicated option for each compression engine is useful because they don't support the same range of values. I ran the same measurement as for the zlib compression level (in the parent changesets). The variation in repository size is stay mostly in the same (small) range. The "read/write" performance see smallish variation, but are overall much better than zlib. Write performance show the same tend of having better write performance for when reaching high-end compression. Again, we don't intend to change the default zstd compression level (currently: 3) in this series. However this is worth investigating in the future. The Performance comparison of zlib vs zstd is quite impressive. The repository size stay in the same range, but the performance are much better in all situations. Comparison summary ================== We are looking at: - performance range for zlib - performance range for zstd - comparison of default zstd (level-3) to default zlib (level 6) - comparison of the slowest zstd time to the fastest zlib time Read performance: ----------------- | zlib | zstd | cmp | f2s mercurial | 0.170159 - 0.189219 | 0.144127 - 0.149624 | 80% | 88% pypy | 2.679217 - 2.768691 | 1.532317 - 1.705044 | 60% | 63% netbeans | 122.477027 - 141.620281 | 72.996346 - 89.731560 | 58% | 73% mozilla | 147.867662 - 170.572118 | 91.700995 - 105.853099 | 56% | 71% Write performance: ------------------ | zlib | zstd | cmp | f2s mercurial | 53.250304 - 56.2936129 | 40.877025 - 45.677286 | 75% | 86% pypy | 460.721984 - 476.589918 | 270.545409 - 301.002219 | 63% | 65% netbeans | 520.560316 - 715.930400 | 370.356311 - 428.329652 | 55% | 82% mozilla | 739.803002 - 987.056093 | 505.152906 - 591.930683 | 57% | 80% Raw data -------- repo alg lvl .hg/store size 00manifest.d read write mercurial zlib 1 49,402,813 5,963,475 0.170159 53.250304 mercurial zlib 6 47,197,397 5,875,730 0.182820 56.264320 mercurial zlib 9 47,121,596 5,849,781 0.189219 56.293612 mercurial zstd 1 49,737,084 5,966,355 0.144127 40.877025 mercurial zstd 3 48,961,867 5,895,208 0.146376 42.268142 mercurial zstd 5 48,200,592 5,938,676 0.149624 43.162875 mercurial zstd 10 47,833,520 5,913,353 0.145185 44.012489 mercurial zstd 15 47,314,604 5,728,679 0.147686 45.677286 mercurial zstd 20 47,330,502 5,830,539 0.145789 45.025407 mercurial zstd 22 47,330,076 5,830,539 0.143996 44.690460 pypy zlib 1 370,830,572 28,462,425 2.679217 460.721984 pypy zlib 6 340,112,317 27,648,747 2.768691 467.537158 pypy zlib 9 338,360,736 27,639,003 2.763495 476.589918 pypy zstd 1 362,377,479 27,916,214 1.532317 270.545409 pypy zstd 3 354,137,693 27,905,988 1.686718 294.951509 pypy zstd 5 342,640,043 27,655,774 1.705044 301.002219 pypy zstd 10 334,224,327 27,164,493 1.567287 285.186239 pypy zstd 15 329,000,363 26,645,965 1.637729 299.561332 pypy zstd 20 324,534,039 26,199,547 1.526813 302.149827 pypy zstd 22 324,530,595 26,198,932 1.525718 307.821218 netbeans zlib 1 1,281,847,810 165,495,457 122.477027 520.560316 netbeans zlib 6 1,205,284,353 159,161,207 139.876147 715.930400 netbeans zlib 9 1,197,135,671 155,034,586 141.620281 678.297064 netbeans zstd 1 1,259,581,737 160,840,613 72.996346 370.356311 netbeans zstd 3 1,232,978,122 157,691,551 81.622317 396.733087 netbeans zstd 5 1,208,034,075 160,246,880 83.080549 364.342626 netbeans zstd 10 1,188,624,176 156,083,417 79.323935 403.594602 netbeans zstd 15 1,176,973,589 153,859,477 89.731560 428.329652 netbeans zstd 20 1,162,958,258 151,147,535 82.842667 392.335349 netbeans zstd 22 1,162,707,029 151,150,220 82.565695 402.840655 mozilla zlib 1 2,775,497,186 298,527,987 147.867662 751.263721 mozilla zlib 6 2,596,856,420 286,597,671 170.572118 987.056093 mozilla zlib 9 2,587,542,494 287,018,264 163.622338 739.803002 mozilla zstd 1 2,723,159,348 286,617,532 91.700995 570.042751 mozilla zstd 3 2,665,055,001 286,152,013 95.240155 561.412805 mozilla zstd 5 2,607,819,817 288,060,030 101.978048 505.152906 mozilla zstd 10 2,558,761,085 283,967,648 104.113481 497.771202 mozilla zstd 15 2,526,216,060 275,581,300 105.853099 591.930683 mozilla zstd 20 2,485,114,806 266,478,859 95.268795 576.515389 mozilla zstd 22 2,484,869,080 266,456,505 94.429282 572.785537
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 27 Mar 2019 18:35:59 +0100
parents 57c462db87fd
children 12243f15d53e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7296
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
1
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
2 $ catpatch() {
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
3 > cat $1 | sed -e "s/^\(# Parent \).*/\1/"
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
4 > }
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
5 $ echo "[extensions]" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
6 $ echo "mq=" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
7 $ runtest() {
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
8 > hg init mq
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
9 > cd mq
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
10 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
11 > echo a > a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
12 > hg ci -Ama
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
13 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
14 > echo '% qnew should refuse bad patch names'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
15 > hg qnew series
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
16 > hg qnew status
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
17 > hg qnew guards
14051
2b1226693c70 mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents: 13197
diff changeset
18 > hg qnew .
2b1226693c70 mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents: 13197
diff changeset
19 > hg qnew ..
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
20 > hg qnew .hgignore
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
21 > hg qnew .mqfoo
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
22 > hg qnew 'foo#bar'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
23 > hg qnew 'foo:bar'
25454
b5a8bc09b0db mq: ban \r and \n in patch names (issue4711)
Augie Fackler <augie@google.com>
parents: 25453
diff changeset
24 > hg qnew "`echo foo; echo bar`"
31556
448acdee9161 mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents: 26998
diff changeset
25 > hg qnew ' foo'
448acdee9161 mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents: 26998
diff changeset
26 > hg qnew 'foo '
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
27 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
28 > hg qinit -c
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
29 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
30 > echo '% qnew with name containing slash'
12878
1634287b6ab1 qnew: give better feedback when doing 'hg qnew foo/' (issue2464)
Martin Geisler <mg@aragost.com>
parents: 12466
diff changeset
31 > hg qnew foo/
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
32 > hg qnew foo/bar.patch
12879
da4a9ed369c8 qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents: 12878
diff changeset
33 > hg qnew foo
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
34 > hg qseries
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
35 > hg qpop
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
36 > hg qdelete foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
37 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
38 > echo '% qnew with uncommitted changes'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
39 > echo a > somefile
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
40 > hg add somefile
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
41 > hg qnew uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
42 > hg st
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
43 > hg qseries
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
44 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
45 > echo '% qnew implies add'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
46 > hg -R .hg/patches st
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
47 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
48 > echo '% qnew missing'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
49 > hg qnew missing.patch missing
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
50 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
51 > echo '% qnew -m'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
52 > hg qnew -m 'foo bar' mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
53 > catpatch .hg/patches/mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
54 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
55 > echo '% qnew twice'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
56 > hg qnew first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
57 > hg qnew first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
58 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
59 > touch ../first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
60 > hg qimport ../first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
61 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
62 > echo '% qnew -f from a subdirectory'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
63 > hg qpop -a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
64 > mkdir d
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
65 > cd d
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
66 > echo b > b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
67 > hg ci -Am t
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
68 > echo b >> b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
69 > hg st
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
70 > hg qnew -g -f p
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
71 > catpatch ../.hg/patches/p
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
72 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
73 > echo '% qnew -u with no username configured'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
74 > HGUSER= hg qnew -u blue red
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
75 > catpatch ../.hg/patches/red
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
76 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
77 > echo '% qnew -e -u with no username configured'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
78 > HGUSER= hg qnew -e -u chartreuse fucsia
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
79 > catpatch ../.hg/patches/fucsia
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
80 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
81 > echo '% fail when trying to import a merge'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
82 > hg init merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
83 > cd merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
84 > touch a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
85 > hg ci -Am null
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
86 > echo a >> a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
87 > hg ci -m a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
88 > hg up -r 0
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
89 > echo b >> a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
90 > hg ci -m b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
91 > hg merge -f 1
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
92 > hg resolve --mark a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
93 > hg qnew -f merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
94 >
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
95 > cd ../../..
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
96 > rm -r mq
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
97 > }
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10372
diff changeset
98
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
99 plain headers
7296
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
100
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
101 $ echo "[mq]" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
102 $ echo "plain=true" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
103 $ mkdir sandbox
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
104 $ (cd sandbox ; runtest)
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
105 adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
106 % qnew should refuse bad patch names
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
107 abort: "series" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
108 abort: "status" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
109 abort: "guards" cannot be used as the name of a patch
14051
2b1226693c70 mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents: 13197
diff changeset
110 abort: "." cannot be used as the name of a patch
2b1226693c70 mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents: 13197
diff changeset
111 abort: ".." cannot be used as the name of a patch
14054
3c616f512a5b mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents: 14051
diff changeset
112 abort: patch name cannot begin with ".hg"
3c616f512a5b mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents: 14051
diff changeset
113 abort: patch name cannot begin with ".mq"
25453
d3a00fc3680f mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents: 22521
diff changeset
114 abort: '#' cannot be used in the name of a patch
d3a00fc3680f mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents: 22521
diff changeset
115 abort: ':' cannot be used in the name of a patch
25454
b5a8bc09b0db mq: ban \r and \n in patch names (issue4711)
Augie Fackler <augie@google.com>
parents: 25453
diff changeset
116 abort: '\n' cannot be used in the name of a patch
31556
448acdee9161 mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents: 26998
diff changeset
117 abort: patch name cannot begin or end with whitespace
448acdee9161 mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents: 26998
diff changeset
118 abort: patch name cannot begin or end with whitespace
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
119 % qnew with name containing slash
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 31556
diff changeset
120 abort: path ends in directory separator: foo/
12879
da4a9ed369c8 qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents: 12878
diff changeset
121 abort: "foo" already exists as a directory
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
122 foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
123 popping foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
124 patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
125 % qnew with uncommitted changes
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
126 uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
127 % qnew implies add
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
128 A .hgignore
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
129 A series
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
130 A uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
131 % qnew missing
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 14054
diff changeset
132 abort: missing: * (glob)
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
133 % qnew -m
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
134 foo bar
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
135
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
136 % qnew twice
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
137 abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
138 abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
139 % qnew -f from a subdirectory
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
140 popping first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
141 popping mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
142 popping uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
143 patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
144 adding d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
145 M d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
146 diff --git a/d/b b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
147 --- a/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
148 +++ b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
149 @@ -1,1 +1,2 @@
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
150 b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
151 +b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
152 % qnew -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
153 From: blue
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
154
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
155 % qnew -e -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
156 From: chartreuse
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
157
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
158 % fail when trying to import a merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
159 adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
160 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
161 created new head
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
162 merging a
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26587
diff changeset
163 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
164 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35393
diff changeset
165 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
21947
b081decd9062 resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21930
diff changeset
166 (no more unresolved files)
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
167 abort: cannot manage merge changesets
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
168 $ rm -r sandbox
2714
85070b784896 Fix test-mq-qnew-twice exit code and output.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2711
diff changeset
169
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
170 hg headers
11575
a5903e612f07 mq: evaluate --user before invoking editor with -e (issue2289)
Brendan Cully <brendan@kublai.com>
parents: 11513
diff changeset
171
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
172 $ echo "plain=false" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
173 $ mkdir sandbox
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
174 $ (cd sandbox ; runtest)
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
175 adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
176 % qnew should refuse bad patch names
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
177 abort: "series" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
178 abort: "status" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
179 abort: "guards" cannot be used as the name of a patch
14051
2b1226693c70 mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents: 13197
diff changeset
180 abort: "." cannot be used as the name of a patch
2b1226693c70 mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents: 13197
diff changeset
181 abort: ".." cannot be used as the name of a patch
14054
3c616f512a5b mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents: 14051
diff changeset
182 abort: patch name cannot begin with ".hg"
3c616f512a5b mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents: 14051
diff changeset
183 abort: patch name cannot begin with ".mq"
25453
d3a00fc3680f mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents: 22521
diff changeset
184 abort: '#' cannot be used in the name of a patch
d3a00fc3680f mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents: 22521
diff changeset
185 abort: ':' cannot be used in the name of a patch
25454
b5a8bc09b0db mq: ban \r and \n in patch names (issue4711)
Augie Fackler <augie@google.com>
parents: 25453
diff changeset
186 abort: '\n' cannot be used in the name of a patch
31556
448acdee9161 mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents: 26998
diff changeset
187 abort: patch name cannot begin or end with whitespace
448acdee9161 mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents: 26998
diff changeset
188 abort: patch name cannot begin or end with whitespace
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
189 % qnew with name containing slash
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 31556
diff changeset
190 abort: path ends in directory separator: foo/
12879
da4a9ed369c8 qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents: 12878
diff changeset
191 abort: "foo" already exists as a directory
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
192 foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
193 popping foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
194 patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
195 % qnew with uncommitted changes
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
196 uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
197 % qnew implies add
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
198 A .hgignore
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
199 A series
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
200 A uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
201 % qnew missing
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 14054
diff changeset
202 abort: missing: * (glob)
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
203 % qnew -m
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
204 # HG changeset patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
205 # Parent
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
206 foo bar
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
207
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
208 % qnew twice
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
209 abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
210 abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
211 % qnew -f from a subdirectory
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
212 popping first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
213 popping mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
214 popping uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
215 patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
216 adding d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
217 M d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
218 # HG changeset patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
219 # Parent
22519
c87f2a5a6e49 mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents: 21947
diff changeset
220
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
221 diff --git a/d/b b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
222 --- a/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
223 +++ b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
224 @@ -1,1 +1,2 @@
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
225 b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
226 +b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
227 % qnew -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
228 # HG changeset patch
22520
9d4ebb75de53 mq: write headers for new HG patches in the same order as export (BC)
Mads Kiilerich <madski@unity3d.com>
parents: 22519
diff changeset
229 # User blue
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
230 # Parent
22519
c87f2a5a6e49 mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents: 21947
diff changeset
231
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
232 % qnew -e -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
233 # HG changeset patch
22520
9d4ebb75de53 mq: write headers for new HG patches in the same order as export (BC)
Mads Kiilerich <madski@unity3d.com>
parents: 22519
diff changeset
234 # User chartreuse
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
235 # Parent
22519
c87f2a5a6e49 mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents: 21947
diff changeset
236
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
237 % fail when trying to import a merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
238 adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
239 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
240 created new head
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
241 merging a
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26587
diff changeset
242 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
243 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35393
diff changeset
244 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
21947
b081decd9062 resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21930
diff changeset
245 (no more unresolved files)
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
246 abort: cannot manage merge changesets
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
247 $ rm -r sandbox
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
248
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
249 Test saving last-message.txt
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
250
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
251 $ hg init repo
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
252 $ cd repo
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
253
20859
e259d4c462b5 tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents: 20768
diff changeset
254 $ cat > $TESTTMP/commitfailure.py <<EOF
26587
56b2bcea2529 error: get Abort from 'error' instead of 'util'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25454
diff changeset
255 > from mercurial import error
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
256 > def reposetup(ui, repo):
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
257 > class commitfailure(repo.__class__):
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
258 > def commit(self, *args, **kwargs):
26587
56b2bcea2529 error: get Abort from 'error' instead of 'util'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25454
diff changeset
259 > raise error.Abort('emulating unexpected abort')
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
260 > repo.__class__ = commitfailure
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
261 > EOF
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
262 $ cat >> .hg/hgrc <<EOF
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
263 > [extensions]
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
264 > # this failure occurs before editor invocation
20859
e259d4c462b5 tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents: 20768
diff changeset
265 > commitfailure = $TESTTMP/commitfailure.py
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
266 > EOF
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
267
20859
e259d4c462b5 tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents: 20768
diff changeset
268 $ cat > $TESTTMP/editor.sh << EOF
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
269 > echo "==== before editing"
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
270 > cat \$1
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
271 > echo "===="
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
272 > echo "test saving last-message.txt" >> \$1
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
273 > EOF
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
274
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
275 (test that editor is not invoked before transaction starting)
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
276
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
277 $ rm -f .hg/last-message.txt
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
278 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
279 abort: emulating unexpected abort
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
280 [255]
21930
a5168eb9b2bc tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21421
diff changeset
281 $ test -f .hg/last-message.txt
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
282 [1]
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
283
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
284 (test that editor is invoked and commit message is saved into
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
285 "last-message.txt")
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
286
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
287 $ cat >> .hg/hgrc <<EOF
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
288 > [extensions]
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
289 > commitfailure = !
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
290 > [hooks]
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
291 > # this failure occurs after editor invocation
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
292 > pretxncommit.unexpectedabort = false
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
293 > EOF
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
294
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
295 $ rm -f .hg/last-message.txt
21421
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
296 $ hg status
20859
e259d4c462b5 tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents: 20768
diff changeset
297 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
298 ==== before editing
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
299
21421
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
300
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
301 HG: Enter commit message. Lines beginning with 'HG:' are removed.
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
302 HG: Leave message empty to use default message.
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
303 HG: --
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
304 HG: user: test
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
305 HG: branch 'default'
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
306 HG: no files changed
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
307 ====
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
308 transaction abort!
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
309 rollback completed
41362
57c462db87fd localrepo: use context manager for transaction in commit()
Martin von Zweigbergk <martinvonz@google.com>
parents: 35704
diff changeset
310 note: commit message saved in .hg/last-message.txt
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
311 abort: pretxncommit.unexpectedabort hook exited with status 1
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
312 [255]
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
313 $ cat .hg/last-message.txt
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
314
21421
4941caa9f0f8 mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21276
diff changeset
315
20768
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
316 test saving last-message.txt
57d0c8c3b947 qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16540
diff changeset
317
21234
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
318 $ cat >> .hg/hgrc <<EOF
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
319 > [hooks]
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
320 > pretxncommit.unexpectedabort =
b9a16ed5acec qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20859
diff changeset
321 > EOF