annotate tests/test-commit.t @ 42070:675775c33ab6

zstandard: vendor python-zstandard 0.11 The upstream source distribution from PyPI was extracted. Unwanted files were removed. The clang-format ignore list was updated to reflect the new source of files. The project contains a vendored copy of zstandard 1.3.8. The old version was 1.3.6. This should result in some minor performance wins. test-check-py3-compat.t was updated to reflect now-passing tests on Python 3.8. Some HTTP tests were updated to reflect new zstd compression output. # no-check-commit because 3rd party code has different style guidelines Differential Revision: https://phab.mercurial-scm.org/D6199
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 04 Apr 2019 17:34:43 -0700
parents 251332dbf33d
children 165b1aad43da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
1 commit date test
1488
08c7851969cc only files in normal state should be marked as deleted
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1203
diff changeset
2
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
3 $ hg init test
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
4 $ cd test
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
5 $ echo foo > foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
6 $ hg add foo
22205
9fa429723f26 ui: invoke editor for committing with HGEDITFORM environment variable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22012
diff changeset
7 $ cat > $TESTTMP/checkeditform.sh <<EOF
9fa429723f26 ui: invoke editor for committing with HGEDITFORM environment variable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22012
diff changeset
8 > env | grep HGEDITFORM
9fa429723f26 ui: invoke editor for committing with HGEDITFORM environment variable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22012
diff changeset
9 > true
9fa429723f26 ui: invoke editor for committing with HGEDITFORM environment variable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22012
diff changeset
10 > EOF
9fa429723f26 ui: invoke editor for committing with HGEDITFORM environment variable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22012
diff changeset
11 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg commit -m ""
22248
75618a223e18 commit: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22205
diff changeset
12 HGEDITFORM=commit.normal.normal
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
13 abort: empty commit message
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
14 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
15 $ hg commit -d '0 0' -m commit-1
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
16 $ echo foo >> foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
17 $ hg commit -d '1 4444444' -m commit-3
32496
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32448
diff changeset
18 hg: parse error: impossible time zone offset: 4444444
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
19 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
20 $ hg commit -d '1 15.1' -m commit-4
32496
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32448
diff changeset
21 hg: parse error: invalid date: '1\t15.1'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
22 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
23 $ hg commit -d 'foo bar' -m commit-5
32496
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32448
diff changeset
24 hg: parse error: invalid date: 'foo bar'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
25 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
26 $ hg commit -d ' 1 4444' -m commit-6
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
27 $ hg commit -d '111111111111 0' -m commit-7
32496
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32448
diff changeset
28 hg: parse error: date exceeds 32 bits: 111111111111
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
29 [255]
28825
87c6ad2251d8 date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
Florent Gallaire <fgallaire@gmail.com>
parents: 26742
diff changeset
30 $ hg commit -d '-111111111111 0' -m commit-7
32496
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32448
diff changeset
31 hg: parse error: date exceeds 32 bits: -111111111111
28825
87c6ad2251d8 date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
Florent Gallaire <fgallaire@gmail.com>
parents: 26742
diff changeset
32 [255]
87c6ad2251d8 date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
Florent Gallaire <fgallaire@gmail.com>
parents: 26742
diff changeset
33 $ echo foo >> foo
28864
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
34 $ hg commit -d '1901-12-13 20:45:52 +0000' -m commit-7-2
28825
87c6ad2251d8 date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
Florent Gallaire <fgallaire@gmail.com>
parents: 26742
diff changeset
35 $ echo foo >> foo
28864
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
36 $ hg commit -d '-2147483648 0' -m commit-7-3
28825
87c6ad2251d8 date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
Florent Gallaire <fgallaire@gmail.com>
parents: 26742
diff changeset
37 $ hg log -T '{rev} {date|isodatesec}\n' -l2
28864
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
38 3 1901-12-13 20:45:52 +0000
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
39 2 1901-12-13 20:45:52 +0000
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
40 $ hg commit -d '1901-12-13 20:45:51 +0000' -m commit-7
32496
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32448
diff changeset
41 hg: parse error: date exceeds 32 bits: -2147483649
28825
87c6ad2251d8 date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
Florent Gallaire <fgallaire@gmail.com>
parents: 26742
diff changeset
42 [255]
28864
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
43 $ hg commit -d '-2147483649 0' -m commit-7
32496
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32448
diff changeset
44 hg: parse error: date exceeds 32 bits: -2147483649
13062
e1002cf9fe54 parsedate: abort on negative dates (issue2513)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12399
diff changeset
45 [255]
3786
8d603f8567ae make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3709
diff changeset
46
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
47 commit added file that has been deleted
3786
8d603f8567ae make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3709
diff changeset
48
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
49 $ echo bar > bar
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
50 $ hg add bar
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
51 $ rm bar
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
52 $ hg commit -m commit-8
13899
a7cd0eee396b commit: note when files are missing
Martin Geisler <mg@aragost.com>
parents: 13447
diff changeset
53 nothing changed (1 missing files, see 'hg status')
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
54 [1]
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
55 $ hg commit -m commit-8-2 bar
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
56 abort: bar: file not found!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
57 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
58
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
59 $ hg -q revert -a --no-backup
3786
8d603f8567ae make hg commit <dirname> work again
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3709
diff changeset
60
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
61 $ mkdir dir
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
62 $ echo boo > dir/file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
63 $ hg add
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 33969
diff changeset
64 adding dir/file
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
65 $ hg -v commit -m commit-9 dir
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
66 committing files:
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
67 dir/file
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
68 committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
69 committing changelog
28864
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
70 committed changeset 4:1957363f1ced
3709
38291d9c8c1c Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 1933
diff changeset
71
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
72 $ echo > dir.file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
73 $ hg add
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
74 adding dir.file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
75 $ hg commit -m commit-10 dir dir.file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
76 abort: dir: no match under directory!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
77 [255]
3709
38291d9c8c1c Expand test-commit to cover one of the recent bugs.
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 1933
diff changeset
78
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
79 $ echo >> dir/file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
80 $ mkdir bleh
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
81 $ mkdir dir2
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
82 $ cd bleh
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
83 $ hg commit -m commit-11 .
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
84 abort: bleh: no match under directory!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
85 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
86 $ hg commit -m commit-12 ../dir ../dir2
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
87 abort: dir2: no match under directory!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
88 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
89 $ hg -v commit -m commit-13 ../dir
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
90 committing files:
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
91 dir/file
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
92 committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
93 committing changelog
28864
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
94 committed changeset 5:a31d8f87544a
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
95 $ cd ..
4253
9e3e975258a9 tests: expand test-commit a bit to test 'hg commit .' too
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 3786
diff changeset
96
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
97 $ hg commit -m commit-14 does-not-exist
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 15447
diff changeset
98 abort: does-not-exist: * (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
99 [255]
16842
a3ea092203a5 tests: introduce c-style conditional sections in .t tests
Mads Kiilerich <mads@kiilerich.com>
parents: 15521
diff changeset
100
a3ea092203a5 tests: introduce c-style conditional sections in .t tests
Mads Kiilerich <mads@kiilerich.com>
parents: 15521
diff changeset
101 #if symlink
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
102 $ ln -s foo baz
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
103 $ hg commit -m commit-15 baz
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
104 abort: baz: file not tracked!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
105 [255]
33576
a41e0f1c9b69 test-commit: stabilize for filesystems without symlink support
Matt Harbison <matt_harbison@yahoo.com>
parents: 33547
diff changeset
106 $ rm baz
16842
a3ea092203a5 tests: introduce c-style conditional sections in .t tests
Mads Kiilerich <mads@kiilerich.com>
parents: 15521
diff changeset
107 #endif
a3ea092203a5 tests: introduce c-style conditional sections in .t tests
Mads Kiilerich <mads@kiilerich.com>
parents: 15521
diff changeset
108
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
109 $ touch quux
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
110 $ hg commit -m commit-16 quux
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
111 abort: quux: file not tracked!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
112 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
113 $ echo >> dir/file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
114 $ hg -v commit -m commit-17 dir/file
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
115 committing files:
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
116 dir/file
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
117 committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23712
diff changeset
118 committing changelog
28864
b0811a9fe67c date: fix boundary check of negative integer
Florent Gallaire <fgallaire@gmail.com>
parents: 28825
diff changeset
119 committed changeset 6:32d054c9d085
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
120
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
121 An empty date was interpreted as epoch origin
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
122
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
123 $ echo foo >> foo
32448
f94d7e3e46a0 devel: activate default-date in tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 32046
diff changeset
124 $ hg commit -d '' -m commit-no-date --config devel.default-date=
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
125 $ hg tip --template '{date|isodate}\n' | grep '1970'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
126 [1]
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
127
33547
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
128 Using the advanced --extra flag
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
129
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
130 $ echo "[extensions]" >> $HGRCPATH
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
131 $ echo "commitextras=" >> $HGRCPATH
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
132 $ hg status
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
133 ? quux
33576
a41e0f1c9b69 test-commit: stabilize for filesystems without symlink support
Matt Harbison <matt_harbison@yahoo.com>
parents: 33547
diff changeset
134 $ hg add quux
a41e0f1c9b69 test-commit: stabilize for filesystems without symlink support
Matt Harbison <matt_harbison@yahoo.com>
parents: 33547
diff changeset
135 $ hg commit -m "adding internal used extras" --extra amend_source=hash
a41e0f1c9b69 test-commit: stabilize for filesystems without symlink support
Matt Harbison <matt_harbison@yahoo.com>
parents: 33547
diff changeset
136 abort: key 'amend_source' is used internally, can't be set manually
a41e0f1c9b69 test-commit: stabilize for filesystems without symlink support
Matt Harbison <matt_harbison@yahoo.com>
parents: 33547
diff changeset
137 [255]
33602
27fbca750b4d commitextras: make sure keys contains ascii letters, numbers, '_' and '-' only
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33576
diff changeset
138 $ hg commit -m "special chars in extra" --extra id@phab=214
27fbca750b4d commitextras: make sure keys contains ascii letters, numbers, '_' and '-' only
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33576
diff changeset
139 abort: keys can only contain ascii letters, digits, '_' and '-'
27fbca750b4d commitextras: make sure keys contains ascii letters, numbers, '_' and '-' only
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33576
diff changeset
140 [255]
33606
806351695c6a commitextras: make sure keys are not empty
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33602
diff changeset
141 $ hg commit -m "empty key" --extra =value
806351695c6a commitextras: make sure keys are not empty
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33602
diff changeset
142 abort: unable to parse '=value', keys can't be empty
806351695c6a commitextras: make sure keys are not empty
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33602
diff changeset
143 [255]
33547
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
144 $ hg commit -m "adding extras" --extra sourcehash=foo --extra oldhash=bar
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
145 $ hg log -r . -T '{extras % "{extra}\n"}'
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
146 branch=default
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
147 oldhash=bar
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
148 sourcehash=foo
a6af8560494e commitextras: check the format of the arguments and no internal key is used
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33365
diff changeset
149
33615
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
150 Failed commit with --addremove should not update dirstate
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
151
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
152 $ echo foo > newfile
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
153 $ hg status
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
154 ? newfile
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
155 $ HGEDITOR=false hg ci --addremove
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
156 adding newfile
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
157 abort: edit failed: false exited with status 1
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
158 [255]
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
159 $ hg status
33616
5ac845ca059a commit: don't let failed commit with --addremove update dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33615
diff changeset
160 ? newfile
33615
d84da82764e3 tests: demonstrate that failed "hg ci -A" updates dirstate (issue5645)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33606
diff changeset
161
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
162 Make sure we do not obscure unknown requires file entries (issue2649)
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
163
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
164 $ echo foo >> foo
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
165 $ echo fake >> .hg/requires
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
166 $ hg commit -m bla
20820
f8e531a3a77c repo: rephrase the "missing requirement" error message
Mads Kiilerich <madski@unity3d.com>
parents: 20773
diff changeset
167 abort: repository requires features unknown to this Mercurial: fake!
26421
4b0fc75f9403 urls: bulk-change primary website URLs
Matt Mackall <mpm@selenic.com>
parents: 25393
diff changeset
168 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
169 [255]
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 13062
diff changeset
170
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
171 $ cd ..
7072
4e0d54fbd34f Show added files as "added" in editor commit message (issue 1330)
Patrick Mezard <pmezard@gmail.com>
parents: 6935
diff changeset
172
4e0d54fbd34f Show added files as "added" in editor commit message (issue 1330)
Patrick Mezard <pmezard@gmail.com>
parents: 6935
diff changeset
173
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
174 partial subdir commit test
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
175
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
176 $ hg init test2
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
177 $ cd test2
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
178 $ mkdir foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
179 $ echo foo > foo/foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
180 $ mkdir bar
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
181 $ echo bar > bar/bar
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
182 $ hg add
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 33969
diff changeset
183 adding bar/bar
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 33969
diff changeset
184 adding foo/foo
21021
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
185 $ HGEDITOR=cat hg ci -e -m commit-subdir-1 foo
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
186 commit-subdir-1
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
187
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
188
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
189 HG: Enter commit message. Lines beginning with 'HG:' are removed.
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
190 HG: Leave message empty to abort commit.
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
191 HG: --
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
192 HG: user: test
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
193 HG: branch 'default'
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
194 HG: added foo/foo
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
195
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
196
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
197 $ hg ci -m commit-subdir-2 bar
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
198
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
199 subdir log 1
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
200
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
201 $ hg log -v foo
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
202 changeset: 0:f97e73a25882
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
203 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
204 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
205 files: foo/foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
206 description:
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
207 commit-subdir-1
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
208
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
209
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
210
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
211 subdir log 2
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
212
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
213 $ hg log -v bar
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
214 changeset: 1:aa809156d50d
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
215 tag: tip
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
216 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
217 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
218 files: bar/bar
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
219 description:
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
220 commit-subdir-2
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
221
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
222
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
223
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
224 full log
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
225
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
226 $ hg log -v
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
227 changeset: 1:aa809156d50d
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
228 tag: tip
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
229 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
230 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
231 files: bar/bar
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
232 description:
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
233 commit-subdir-2
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
234
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
235
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
236 changeset: 0:f97e73a25882
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
237 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
238 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
239 files: foo/foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
240 description:
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
241 commit-subdir-1
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
242
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
243
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
244 $ cd ..
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
245
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
246
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
247 dot and subdir commit test
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
248
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
249 $ hg init test3
21021
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
250 $ echo commit-foo-subdir > commit-log-test
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
251 $ cd test3
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
252 $ mkdir foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
253 $ echo foo content > foo/plain-file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
254 $ hg add foo/plain-file
21021
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
255 $ HGEDITOR=cat hg ci --edit -l ../commit-log-test foo
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
256 commit-foo-subdir
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
257
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
258
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
259 HG: Enter commit message. Lines beginning with 'HG:' are removed.
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
260 HG: Leave message empty to abort commit.
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
261 HG: --
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
262 HG: user: test
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
263 HG: branch 'default'
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
264 HG: added foo/plain-file
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
265
422981492ace commit: --edit/-e to force edit of otherwise-supplied commit message
"Bradley M. Kuhn" <bkuhn@ebb.org>
parents: 20860
diff changeset
266
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
267 $ echo modified foo content > foo/plain-file
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
268 $ hg ci -m commit-foo-dot .
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
269
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
270 full log
7072
4e0d54fbd34f Show added files as "added" in editor commit message (issue 1330)
Patrick Mezard <pmezard@gmail.com>
parents: 6935
diff changeset
271
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
272 $ hg log -v
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
273 changeset: 1:95b38e3a5b2e
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
274 tag: tip
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
275 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
276 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
277 files: foo/plain-file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
278 description:
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
279 commit-foo-dot
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
280
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
281
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
282 changeset: 0:65d4e9386227
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
283 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
284 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
285 files: foo/plain-file
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
286 description:
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
287 commit-foo-subdir
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
288
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
289
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
290
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
291 subdir log
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
292
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
293 $ cd foo
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
294 $ hg log .
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
295 changeset: 1:95b38e3a5b2e
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
296 tag: tip
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
297 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
298 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
299 summary: commit-foo-dot
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
300
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
301 changeset: 0:65d4e9386227
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
302 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12105
diff changeset
303 date: Thu Jan 01 00:00:00 1970 +0000
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
304 summary: commit-foo-subdir
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
305
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
306 $ cd ..
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
307 $ cd ..
6386
bae2e9c838e9 Tests for issue 1049
Bryan O'Sullivan <bos@serpentine.com>
parents: 6112
diff changeset
308
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12327
diff changeset
309 Issue1049: Hg permits partial commit of merge without warning
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12327
diff changeset
310
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
311 $ hg init issue1049
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
312 $ cd issue1049
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
313 $ echo a > a
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
314 $ hg ci -Ama
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
315 adding a
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
316 $ echo a >> a
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
317 $ hg ci -mb
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
318 $ hg up 0
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
319 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
320 $ echo b >> a
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
321 $ hg ci -mc
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
322 created new head
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
323 $ HGMERGE=true hg merge
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
324 merging a
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
325 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
326 (branch merge, don't forget to commit)
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
327
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
328 should fail because we are specifying a file name
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
329
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
330 $ hg ci -mmerge a
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
331 abort: cannot partially commit a merge (do not specify files or patterns)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
332 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
333
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
334 should fail because we are specifying a pattern
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
335
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
336 $ hg ci -mmerge -I a
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
337 abort: cannot partially commit a merge (do not specify files or patterns)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
338 [255]
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
339
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
340 should succeed
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
341
22248
75618a223e18 commit: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22205
diff changeset
342 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg ci -mmerge --edit
75618a223e18 commit: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22205
diff changeset
343 HGEDITFORM=commit.normal.merge
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
344 $ cd ..
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
345
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
346
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
347 test commit message content
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
348
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
349 $ hg init commitmsg
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
350 $ cd commitmsg
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
351 $ echo changed > changed
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
352 $ echo removed > removed
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
353 $ hg book activebookmark
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
354 $ hg ci -qAm init
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
355
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
356 $ hg rm removed
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
357 $ echo changed >> changed
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
358 $ echo added > added
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
359 $ hg add added
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
360 $ HGEDITOR=cat hg ci -A
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
361
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
362
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
363 HG: Enter commit message. Lines beginning with 'HG:' are removed.
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
364 HG: Leave message empty to abort commit.
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
365 HG: --
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
366 HG: user: test
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
367 HG: branch 'default'
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
368 HG: bookmark 'activebookmark'
11802
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
369 HG: added added
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
370 HG: changed changed
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
371 HG: removed removed
d26b7cc96bc4 tests: unify test-commit
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8168
diff changeset
372 abort: empty commit message
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
373 [255]
20765
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
374
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
375 test saving last-message.txt
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
376
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
377 $ hg init sub
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
378 $ echo a > sub/a
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
379 $ hg -R sub add sub/a
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
380 $ cat > sub/.hg/hgrc <<EOF
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
381 > [hooks]
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
382 > precommit.test-saving-last-message = false
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
383 > EOF
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
384
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
385 $ echo 'sub = sub' > .hgsub
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
386 $ hg add .hgsub
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
387
20859
e259d4c462b5 tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents: 20765
diff changeset
388 $ cat > $TESTTMP/editor.sh <<EOF
20765
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
389 > echo "==== before editing:"
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
390 > cat \$1
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
391 > echo "===="
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
392 > echo "test saving last-message.txt" >> \$1
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
393 > EOF
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
394
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
395 $ rm -f .hg/last-message.txt
20859
e259d4c462b5 tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents: 20765
diff changeset
396 $ HGEDITOR="sh $TESTTMP/editor.sh" hg commit -S -q
20765
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
397 ==== before editing:
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
398
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
399
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
400 HG: Enter commit message. Lines beginning with 'HG:' are removed.
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
401 HG: Leave message empty to abort commit.
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
402 HG: --
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
403 HG: user: test
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
404 HG: branch 'default'
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
405 HG: bookmark 'activebookmark'
20765
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
406 HG: subrepo sub
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
407 HG: added .hgsub
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
408 HG: added added
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
409 HG: changed .hgsubstate
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
410 HG: changed changed
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
411 HG: removed removed
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
412 ====
33365
6d88468d435b subrepo: make the output references to subrepositories consistent
Matt Harbison <matt_harbison@yahoo.com>
parents: 32496
diff changeset
413 abort: precommit.test-saving-last-message hook exited with status 1 (in subrepository "sub")
20765
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
414 [255]
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
415 $ cat .hg/last-message.txt
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
416
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
417
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
418 test saving last-message.txt
f042d4b263f4 localrepo: save manually edited commit message as soon as possible
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18538
diff changeset
419
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
420 test that '[committemplate] changeset' definition and commit log
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
421 specific template keywords work well
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
422
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
423 $ cat >> .hg/hgrc <<EOF
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
424 > [committemplate]
32046
5b630f2ccb4e commit: optionally strip quotes from commit template (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 30724
diff changeset
425 > changeset.commit.normal = 'HG: this is "commit.normal" template
22012
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
426 > HG: {extramsg}
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
427 > {if(activebookmark,
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
428 > "HG: bookmark '{activebookmark}' is activated\n",
22012
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
429 > "HG: no bookmark is activated\n")}{subrepos %
32046
5b630f2ccb4e commit: optionally strip quotes from commit template (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 30724
diff changeset
430 > "HG: subrepo '{subrepo}' is changed\n"}'
22012
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
431 >
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
432 > changeset.commit = HG: this is "commit" template
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
433 > HG: {extramsg}
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
434 > {if(activebookmark,
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
435 > "HG: bookmark '{activebookmark}' is activated\n",
22012
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
436 > "HG: no bookmark is activated\n")}{subrepos %
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
437 > "HG: subrepo '{subrepo}' is changed\n"}
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
438 >
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
439 > changeset = HG: this is customized commit template
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
440 > HG: {extramsg}
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
441 > {if(activebookmark,
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
442 > "HG: bookmark '{activebookmark}' is activated\n",
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
443 > "HG: no bookmark is activated\n")}{subrepos %
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
444 > "HG: subrepo '{subrepo}' is changed\n"}
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
445 > EOF
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
446
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
447 $ hg init sub2
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
448 $ echo a > sub2/a
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
449 $ hg -R sub2 add sub2/a
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
450 $ echo 'sub2 = sub2' >> .hgsub
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
451
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
452 $ HGEDITOR=cat hg commit -S -q
22012
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
453 HG: this is "commit.normal" template
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
454 HG: Leave message empty to abort commit.
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
455 HG: bookmark 'activebookmark' is activated
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
456 HG: subrepo 'sub' is changed
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
457 HG: subrepo 'sub2' is changed
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
458 abort: empty commit message
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
459 [255]
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
460
22012
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
461 $ cat >> .hg/hgrc <<EOF
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
462 > [committemplate]
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
463 > changeset.commit.normal =
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
464 > # now, "changeset.commit" should be chosen for "hg commit"
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
465 > EOF
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
466
25014
7e5d5160073b templatekw: replace currentbookmark with activebookmark keyword
Ryan McElroy <rmcelroy@fb.com>
parents: 23749
diff changeset
467 $ hg bookmark --inactive activebookmark
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
468 $ hg forget .hgsub
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
469 $ HGEDITOR=cat hg commit -q
22012
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
470 HG: this is "commit" template
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
471 HG: Leave message empty to abort commit.
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
472 HG: no bookmark is activated
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
473 abort: empty commit message
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
474 [255]
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
475
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
476 $ cat >> .hg/hgrc <<EOF
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
477 > [committemplate]
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
478 > changeset.commit =
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
479 > # now, "changeset" should be chosen for "hg commit"
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
480 > EOF
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
481
9d92b9d1e282 cmdutil: look commit template definition up by specified 'editform'
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21924
diff changeset
482 $ HGEDITOR=cat hg commit -q
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
483 HG: this is customized commit template
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
484 HG: Leave message empty to abort commit.
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
485 HG: no bookmark is activated
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
486 abort: empty commit message
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
487 [255]
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
488
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
489 $ cat >> .hg/hgrc <<EOF
23711
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
490 > [committemplate]
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
491 > changeset = {desc}
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
492 > HG: mods={file_mods}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
493 > HG: adds={file_adds}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
494 > HG: dels={file_dels}
23711
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
495 > HG: files={files}
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
496 > HG:
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
497 > {splitlines(diff()) % 'HG: {line}\n'
23711
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
498 > }HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
499 > HG: mods={file_mods}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
500 > HG: adds={file_adds}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
501 > HG: dels={file_dels}
23711
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
502 > HG: files={files}\n
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
503 > EOF
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
504 $ hg status -amr
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
505 M changed
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
506 A added
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
507 R removed
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
508 $ HGEDITOR=cat hg commit -q -e -m "foo bar" changed
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
509 foo bar
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
510 HG: mods=changed
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
511 HG: adds=
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
512 HG: dels=
23711
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
513 HG: files=changed
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
514 HG:
41793
251332dbf33d diff: make sure we output stat even when --git is not passed (issue4037) (BC)
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39900
diff changeset
515 HG: diff -r d2313f97106f changed
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
516 HG: --- a/changed Thu Jan 01 00:00:00 1970 +0000
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
517 HG: +++ b/changed Thu Jan 01 00:00:00 1970 +0000
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
518 HG: @@ -1,1 +1,2 @@
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
519 HG: changed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
520 HG: +changed
23711
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
521 HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
522 HG: mods=changed
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
523 HG: adds=
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
524 HG: dels=
23711
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
525 HG: files=changed
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
526 $ hg status -amr
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
527 A added
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
528 R removed
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
529 $ hg parents --template "M {file_mods}\nA {file_adds}\nR {file_dels}\n"
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
530 M changed
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
531 A
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
532 R
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
533 $ hg rollback -q
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
534
1e6fb8db666e context: avoid breaking already fixed self._status at ctx.status()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23627
diff changeset
535 $ cat >> .hg/hgrc <<EOF
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
536 > [committemplate]
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
537 > changeset = {desc}
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
538 > HG: mods={file_mods}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
539 > HG: adds={file_adds}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
540 > HG: dels={file_dels}
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
541 > HG: files={files}
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
542 > HG:
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
543 > {splitlines(diff("changed")) % 'HG: {line}\n'
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
544 > }HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
545 > HG: mods={file_mods}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
546 > HG: adds={file_adds}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
547 > HG: dels={file_dels}
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
548 > HG: files={files}
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
549 > HG:
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
550 > {splitlines(diff("added")) % 'HG: {line}\n'
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
551 > }HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
552 > HG: mods={file_mods}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
553 > HG: adds={file_adds}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
554 > HG: dels={file_dels}
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
555 > HG: files={files}
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
556 > HG:
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
557 > {splitlines(diff("removed")) % 'HG: {line}\n'
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
558 > }HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
559 > HG: mods={file_mods}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
560 > HG: adds={file_adds}
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
561 > HG: dels={file_dels}
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
562 > HG: files={files}\n
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
563 > EOF
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
564 $ HGEDITOR=cat hg commit -q -e -m "foo bar" added removed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
565 foo bar
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
566 HG: mods=
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
567 HG: adds=added
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
568 HG: dels=removed
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
569 HG: files=added removed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
570 HG:
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
571 HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
572 HG: mods=
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
573 HG: adds=added
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
574 HG: dels=removed
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
575 HG: files=added removed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
576 HG:
41793
251332dbf33d diff: make sure we output stat even when --git is not passed (issue4037) (BC)
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39900
diff changeset
577 HG: diff -r d2313f97106f added
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
578 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
579 HG: +++ b/added Thu Jan 01 00:00:00 1970 +0000
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
580 HG: @@ -0,0 +1,1 @@
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
581 HG: +added
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
582 HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
583 HG: mods=
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
584 HG: adds=added
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
585 HG: dels=removed
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
586 HG: files=added removed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
587 HG:
41793
251332dbf33d diff: make sure we output stat even when --git is not passed (issue4037) (BC)
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39900
diff changeset
588 HG: diff -r d2313f97106f removed
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
589 HG: --- a/removed Thu Jan 01 00:00:00 1970 +0000
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
590 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
591 HG: @@ -1,1 +0,0 @@
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
592 HG: -removed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
593 HG:
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
594 HG: mods=
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
595 HG: adds=added
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23749
diff changeset
596 HG: dels=removed
23712
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
597 HG: files=added removed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
598 $ hg status -amr
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
599 M changed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
600 $ hg parents --template "M {file_mods}\nA {file_adds}\nR {file_dels}\n"
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
601 M
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
602 A added
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
603 R removed
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
604 $ hg rollback -q
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
605
bfce25d25c96 context: override _dirstatestatus in workingcommitctx for correct matching
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23711
diff changeset
606 $ cat >> .hg/hgrc <<EOF
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
607 > # disable customizing for subsequent tests
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
608 > [committemplate]
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
609 > changeset =
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
610 > EOF
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21021
diff changeset
611
16849
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
612 $ cd ..
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
613
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
614
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
615 commit copy
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
616
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
617 $ hg init dir2
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
618 $ cd dir2
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
619 $ echo bleh > bar
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
620 $ hg add bar
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
621 $ hg ci -m 'add bar'
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
622
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
623 $ hg cp bar foo
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
624 $ echo >> bar
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
625 $ hg ci -m 'cp bar foo; change bar'
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
626
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
627 $ hg debugrename foo
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
628 foo renamed from bar:26d3ca0dfd18e44d796b564e38dd173c9668d3a9
928ee57e3aae tests: roll test-commit-copy.t into test-commit.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 16842
diff changeset
629 $ hg debugindex bar
37285
d4e62df1c73d debugcommands: drop offset and length from debugindex by default
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37284
diff changeset
630 rev linkrev nodeid p1 p2
d4e62df1c73d debugcommands: drop offset and length from debugindex by default
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37284
diff changeset
631 0 0 26d3ca0dfd18 000000000000 000000000000
d4e62df1c73d debugcommands: drop offset and length from debugindex by default
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37284
diff changeset
632 1 1 d267bddd54f7 26d3ca0dfd18 000000000000
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16896
diff changeset
633
25018
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
634 Test making empty commits
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
635 $ hg commit --config ui.allowemptycommit=True -m "empty commit"
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
636 $ hg log -r . -v --stat
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
637 changeset: 2:d809f3644287
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
638 tag: tip
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
639 user: test
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
640 date: Thu Jan 01 00:00:00 1970 +0000
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
641 description:
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
642 empty commit
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
643
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
644
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
645
23598
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
646 verify pathauditor blocks evil filepaths
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
647 $ cat > evil-commit.py <<EOF
33969
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
648 > from __future__ import absolute_import
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
649 > from mercurial import context, hg, node, ui as uimod
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
650 > notrc = u".h\u200cg".encode('utf-8') + b'/hgrc'
33969
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
651 > u = uimod.ui.load()
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
652 > r = hg.repository(u, b'.')
23598
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
653 > def filectxfn(repo, memctx, path):
35407
8a0cac20a1ad memfilectx: make changectx argument mandatory in constructor (API)
Martin von Zweigbergk <martinvonz@google.com>
parents: 35400
diff changeset
654 > return context.memfilectx(repo, memctx, path,
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
655 > b'[hooks]\nupdate = echo owned')
39900
1a184b727aff repo: don't look up context for tip node if it's not needed
Martin von Zweigbergk <martinvonz@google.com>
parents: 39723
diff changeset
656 > c = context.memctx(r, [r.changelog.tip(), node.nullid],
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
657 > b'evil', [notrc], filectxfn, 0)
23598
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
658 > r.commitctx(c)
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
659 > EOF
39723
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 37285
diff changeset
660 $ "$PYTHON" evil-commit.py
23627
7aaf987d9e88 tests: add missing globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 23604
diff changeset
661 #if windows
7aaf987d9e88 tests: add missing globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 23604
diff changeset
662 $ hg co --clean tip
7aaf987d9e88 tests: add missing globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 23604
diff changeset
663 abort: path contains illegal component: .h\xe2\x80\x8cg\\hgrc (esc)
7aaf987d9e88 tests: add missing globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 23604
diff changeset
664 [255]
7aaf987d9e88 tests: add missing globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 23604
diff changeset
665 #else
23598
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
666 $ hg co --clean tip
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
667 abort: path contains illegal component: .h\xe2\x80\x8cg/hgrc (esc)
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
668 [255]
23627
7aaf987d9e88 tests: add missing globs for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 23604
diff changeset
669 #endif
23598
c02a05cc6f5e pathauditor: check for codepoints ignored on OS X
Augie Fackler <raf@durin42.com>
parents: 22248
diff changeset
670
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
671 $ hg rollback -f
25018
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
672 repository tip rolled back to revision 2 (undo commit)
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
673 $ cat > evil-commit.py <<EOF
33969
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
674 > from __future__ import absolute_import
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
675 > from mercurial import context, hg, node, ui as uimod
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
676 > notrc = b"HG~1/hgrc"
33969
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
677 > u = uimod.ui.load()
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
678 > r = hg.repository(u, b'.')
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
679 > def filectxfn(repo, memctx, path):
35407
8a0cac20a1ad memfilectx: make changectx argument mandatory in constructor (API)
Martin von Zweigbergk <martinvonz@google.com>
parents: 35400
diff changeset
680 > return context.memfilectx(repo, memctx, path,
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
681 > b'[hooks]\nupdate = echo owned')
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
682 > c = context.memctx(r, [r[b'tip'].node(), node.nullid],
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
683 > b'evil', [notrc], filectxfn, 0)
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
684 > r.commitctx(c)
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
685 > EOF
39723
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 37285
diff changeset
686 $ "$PYTHON" evil-commit.py
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
687 $ hg co --clean tip
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 33969
diff changeset
688 abort: path contains illegal component: HG~1/hgrc
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
689 [255]
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
690
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
691 $ hg rollback -f
25018
93e015a3d1ea commit: add ui.allowemptycommit config option
Durham Goode <durham@fb.com>
parents: 25014
diff changeset
692 repository tip rolled back to revision 2 (undo commit)
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
693 $ cat > evil-commit.py <<EOF
33969
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
694 > from __future__ import absolute_import
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
695 > from mercurial import context, hg, node, ui as uimod
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
696 > notrc = b"HG8B6C~2/hgrc"
33969
335d45e74381 tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33616
diff changeset
697 > u = uimod.ui.load()
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
698 > r = hg.repository(u, b'.')
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
699 > def filectxfn(repo, memctx, path):
35407
8a0cac20a1ad memfilectx: make changectx argument mandatory in constructor (API)
Martin von Zweigbergk <martinvonz@google.com>
parents: 35400
diff changeset
700 > return context.memfilectx(repo, memctx, path,
36450
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
701 > b'[hooks]\nupdate = echo owned')
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
702 > c = context.memctx(r, [r[b'tip'].node(), node.nullid],
a39126a40be6 tests: add missing b prefixes in test-commit.t
Augie Fackler <augie@google.com>
parents: 35407
diff changeset
703 > b'evil', [notrc], filectxfn, 0)
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
704 > r.commitctx(c)
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
705 > EOF
39723
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 37285
diff changeset
706 $ "$PYTHON" evil-commit.py
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
707 $ hg co --clean tip
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 33969
diff changeset
708 abort: path contains illegal component: HG8B6C~2/hgrc
23599
6dad422ecc5a pathauditor: check for Windows shortname aliases
Matt Mackall <mpm@selenic.com>
parents: 23598
diff changeset
709 [255]
26742
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
710
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
711 # test that an unmodified commit template message aborts
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
712
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
713 $ hg init unmodified_commit_template
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
714 $ cd unmodified_commit_template
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
715 $ echo foo > foo
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
716 $ hg add foo
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
717 $ hg commit -m "foo"
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
718 $ cat >> .hg/hgrc <<EOF
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
719 > [committemplate]
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
720 > changeset.commit = HI THIS IS NOT STRIPPED
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
721 > HG: this is customized commit template
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
722 > HG: {extramsg}
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
723 > {if(activebookmark,
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
724 > "HG: bookmark '{activebookmark}' is activated\n",
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
725 > "HG: no bookmark is activated\n")}{subrepos %
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
726 > "HG: subrepo '{subrepo}' is changed\n"}
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
727 > EOF
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
728 $ cat > $TESTTMP/notouching.sh <<EOF
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
729 > true
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
730 > EOF
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
731 $ echo foo2 > foo2
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
732 $ hg add foo2
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
733 $ HGEDITOR="sh $TESTTMP/notouching.sh" hg commit
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
734 abort: commit message unchanged
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
735 [255]
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
736
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
737 test that text below the --- >8 --- special string is ignored
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
738
30723
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
739 $ cat <<'EOF' > $TESTTMP/lowercaseline.sh
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
740 > cat $1 | sed s/LINE/line/ | tee $1.new
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
741 > mv $1.new $1
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
742 > EOF
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
743
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
744 $ hg init ignore_below_special_string
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
745 $ cd ignore_below_special_string
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
746 $ echo foo > foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
747 $ hg add foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
748 $ hg commit -m "foo"
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
749 $ cat >> .hg/hgrc <<EOF
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
750 > [committemplate]
30723
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
751 > changeset.commit = first LINE
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
752 > HG: this is customized commit template
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
753 > HG: {extramsg}
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
754 > HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
755 > {diff()}
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
756 > EOF
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
757 $ echo foo2 > foo2
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
758 $ hg add foo2
30724
ee47e951c6f9 commit: fix unmodified message detection for the "--- >8 ----" magic
Yuya Nishihara <yuya@tcha.org>
parents: 30723
diff changeset
759 $ HGEDITOR="sh $TESTTMP/notouching.sh" hg ci
ee47e951c6f9 commit: fix unmodified message detection for the "--- >8 ----" magic
Yuya Nishihara <yuya@tcha.org>
parents: 30723
diff changeset
760 abort: commit message unchanged
ee47e951c6f9 commit: fix unmodified message detection for the "--- >8 ----" magic
Yuya Nishihara <yuya@tcha.org>
parents: 30723
diff changeset
761 [255]
30723
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
762 $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
763 first line
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
764 HG: this is customized commit template
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
765 HG: Leave message empty to abort commit.
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
766 HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
767 diff -r e63c23eaa88a foo2
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
768 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
769 +++ b/foo2 Thu Jan 01 00:00:00 1970 +0000
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
770 @@ -0,0 +1,1 @@
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
771 +foo2
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
772 $ hg log -T '{desc}\n' -r .
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
773 first line
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
774
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
775 test that the special string --- >8 --- isn't used when not at the beginning of
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
776 a line
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
777
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
778 $ cat >> .hg/hgrc <<EOF
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
779 > [committemplate]
30723
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
780 > changeset.commit = first LINE2
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
781 > another line HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
782 > HG: this is customized commit template
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
783 > HG: {extramsg}
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
784 > HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
785 > {diff()}
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
786 > EOF
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
787 $ echo foo >> foo
30723
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
788 $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
789 first line2
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
790 another line HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
791 HG: this is customized commit template
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
792 HG: Leave message empty to abort commit.
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
793 HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
794 diff -r 3661b22b0702 foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
795 --- a/foo Thu Jan 01 00:00:00 1970 +0000
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
796 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
797 @@ -1,1 +1,2 @@
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
798 foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
799 +foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
800 $ hg log -T '{desc}\n' -r .
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
801 first line2
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
802 another line HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
803
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
804 also test that this special string isn't accepted when there is some extra text
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
805 at the end
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
806
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
807 $ cat >> .hg/hgrc <<EOF
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
808 > [committemplate]
30723
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
809 > changeset.commit = first LINE3
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
810 > HG: ------------------------ >8 ------------------------foobar
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
811 > second line
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
812 > HG: this is customized commit template
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
813 > HG: {extramsg}
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
814 > HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
815 > {diff()}
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
816 > EOF
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
817 $ echo foo >> foo
30723
6ef9f32d76c6 commit: update test to actually modify template text
Yuya Nishihara <yuya@tcha.org>
parents: 30703
diff changeset
818 $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
30703
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
819 first line3
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
820 HG: ------------------------ >8 ------------------------foobar
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
821 second line
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
822 HG: this is customized commit template
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
823 HG: Leave message empty to abort commit.
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
824 HG: ------------------------ >8 ------------------------
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
825 diff -r ce648f5f066f foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
826 --- a/foo Thu Jan 01 00:00:00 1970 +0000
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
827 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
828 @@ -1,2 +1,3 @@
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
829 foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
830 foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
831 +foo
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
832 $ hg log -T '{desc}\n' -r .
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
833 first line3
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
834 second line
5c85c93cdd61 cmdutil: add special string that ignores rest of text
Sean Farley <sean@farley.io>
parents: 30564
diff changeset
835
26742
bec1a579ebc4 commit: abort when a committemplate is not changed
Tony Tung <tonytung@fb.com>
parents: 26421
diff changeset
836 $ cd ..