annotate tests/test-commit-amend.t @ 23748:4ab66de46a96

bundle: when verbose, show what takes up the space in the generated bundle This is kind of similar to the debugbundle command but gives summarized actual uncompressed number of bytes when creating the bundle. The numbers are as usable as the bundle format is efficient. Hopefully bundle2 will make it a better indicator of actual entropy. This is useful when accepting pull requests to assess whether the repo size increase seems reasonable for the diff before pushing stuff upstream, It has helped me catching large files that should have been committed as largefiles but was committed as regular files in intermediate changesets. This output doesn't combine well with debug output so we only enable it when verbose without debug.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 15 Aug 2014 19:43:32 +0200
parents 200215cdf7aa
children a387b0390082
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 $ hg init
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 Setup:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 $ hg ci -Am 'base'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 adding a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 Refuse to amend public csets:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11 $ hg phase -r . -p
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 abort: cannot amend public changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 [255]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15 $ hg phase -r . -f -d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 $ hg ci -Am 'base1'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
20 Nothing to amend:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22 $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
23 nothing changed
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24 [1]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
25
17060
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
26 $ cat >> $HGRCPATH <<EOF
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
27 > [hooks]
17462
8085fed2bf0a tests: correct quoting of double quotes in here documents used to write hooks
Jim Hague <jim.hague@acm.org>
parents: 17461
diff changeset
28 > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
17060
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
29 > EOF
17049
2440822446ce amend: disable hooks when creating intermediate commit (issue3501)
Idan Kamara <idankk86@gmail.com>
parents: 16630
diff changeset
30
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
31 Amending changeset with changes in working dir:
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
32 (and check that --message does not trigger an editor)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
33
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
34 $ echo a >> a
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
35 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
36 pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
37 43f1ba15f28a tip
17060
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
38 saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg (glob)
17049
2440822446ce amend: disable hooks when creating intermediate commit (issue3501)
Idan Kamara <idankk86@gmail.com>
parents: 16630
diff changeset
39 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
40 $ hg diff -c .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
41 diff -r ad120869acf0 -r 43f1ba15f28a a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
42 --- a/a Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
43 +++ b/a Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
44 @@ -1,1 +1,3 @@
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
45 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
46 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
47 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
48 $ hg log
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
49 changeset: 1:43f1ba15f28a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
50 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
51 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
52 date: Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
53 summary: amend base1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
54
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
55 changeset: 0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
56 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
57 date: Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
58 summary: base
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
59
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
60
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
61 Check proper abort for empty message
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
62
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
63 $ cat > editor.sh << '__EOF__'
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
64 > #!/bin/sh
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
65 > echo "" > "$1"
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
66 > __EOF__
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
67 $ echo b > b
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
68 $ hg add b
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
69 $ hg summary
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
70 parent: 1:43f1ba15f28a tip
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
71 amend base1
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
72 branch: default
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
73 commit: 1 added, 1 unknown
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
74 update: (current)
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
75 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
76 transaction abort!
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
77 rollback completed
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
78 abort: empty commit message
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
79 [255]
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
80 $ hg summary
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
81 parent: 1:43f1ba15f28a tip
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
82 amend base1
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
83 branch: default
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
84 commit: 1 added, 1 unknown
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
85 update: (current)
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
86
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
87 Add new file:
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
88 $ hg ci --amend -m 'amend base1 new file'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
89 saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
90
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
91 Remove file that was added in amended commit:
17863
034e55bbf7c0 amend: fix incompatibity between logfile and message option (issue3675)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17811
diff changeset
92 (and test logfile option)
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
93 (and test that logfile option do not trigger an editor)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
94
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
95 $ hg rm b
17863
034e55bbf7c0 amend: fix incompatibity between logfile and message option (issue3675)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17811
diff changeset
96 $ echo 'amend base1 remove new file' > ../logfile
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
97 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
98 saved backup bundle to $TESTTMP/.hg/strip-backup/b8e3cb2b3882-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
99
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
100 $ hg cat b
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
101 b: no such file in rev 74609c7f506e
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
102 [1]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
103
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
104 No changes, just a different message:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
105
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
106 $ hg ci -v --amend -m 'no changes, new message'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
107 amending changeset 74609c7f506e
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
108 copying changeset 74609c7f506e to ad120869acf0
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
109 a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
110 stripping amended changeset 74609c7f506e
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
111 1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
112 uncompressed size of bundle content:
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
113 250 (changelog)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
114 143 (manifests)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
115 109 a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
116 saved backup bundle to $TESTTMP/.hg/strip-backup/74609c7f506e-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
117 1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
118 uncompressed size of bundle content:
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
119 246 (changelog)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
120 143 (manifests)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
121 109 a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
122 adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
123 adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
124 adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
125 adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
126 added 1 changesets with 1 changes to 1 files
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
127 committed changeset 1:1cd866679df8
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
128 $ hg diff -c .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
129 diff -r ad120869acf0 -r 1cd866679df8 a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
130 --- a/a Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
131 +++ b/a Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
132 @@ -1,1 +1,3 @@
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
133 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
134 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
135 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
136 $ hg log
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
137 changeset: 1:1cd866679df8
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
138 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
139 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
140 date: Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
141 summary: no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
142
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
143 changeset: 0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
144 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
145 date: Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
146 summary: base
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
147
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
148
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
149 Disable default date on commit so when -d isn't given, the old date is preserved:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
150
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
151 $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
152 $ echo 'commit=' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
153
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
154 Test -u/-d:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
155
22249
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
156 $ cat > .hg/checkeditform.sh <<EOF
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
157 > env | grep HGEDITFORM
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
158 > true
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
159 > EOF
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
160 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0'
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
161 HGEDITFORM=commit.amend.normal
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
162 saved backup bundle to $TESTTMP/.hg/strip-backup/1cd866679df8-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
163 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
164 $ hg ci --amend -u foo -d '1 0'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
165 saved backup bundle to $TESTTMP/.hg/strip-backup/780e6f23e03d-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
166 $ hg log -r .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
167 changeset: 1:5f357c7560ab
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
168 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
169 user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
170 date: Thu Jan 01 00:00:01 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
171 summary: no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
172
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
173
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
174 Open editor with old commit message if a message isn't given otherwise:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
175
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
176 $ cat > editor.sh << '__EOF__'
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
177 > #!/bin/sh
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
178 > cat $1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
179 > echo "another precious commit message" > "$1"
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
180 > __EOF__
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
181
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
182 at first, test saving last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
183
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
184 $ cat > .hg/hgrc << '__EOF__'
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
185 > [hooks]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
186 > pretxncommit.test-saving-last-message = false
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
187 > __EOF__
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
188
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
189 $ rm -f .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
190 $ hg commit --amend -v -m "message given from command line"
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
191 amending changeset 5f357c7560ab
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
192 copying changeset 5f357c7560ab to ad120869acf0
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
193 a
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
194 running hook pretxncommit.test-saving-last-message: false
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
195 transaction abort!
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
196 rollback completed
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
197 abort: pretxncommit.test-saving-last-message hook exited with status 1
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
198 [255]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
199 $ cat .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
200 message given from command line (no-eol)
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
201
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
202 $ rm -f .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
203 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
204 amending changeset 5f357c7560ab
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
205 copying changeset 5f357c7560ab to ad120869acf0
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
206 no changes, new message
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
207
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
208
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
209 HG: Enter commit message. Lines beginning with 'HG:' are removed.
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
210 HG: Leave message empty to abort commit.
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
211 HG: --
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
212 HG: user: foo
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
213 HG: branch 'default'
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
214 HG: changed a
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
215 a
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
216 running hook pretxncommit.test-saving-last-message: false
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
217 transaction abort!
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
218 rollback completed
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
219 abort: pretxncommit.test-saving-last-message hook exited with status 1
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
220 [255]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
221
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
222 $ cat .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
223 another precious commit message
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
224
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
225 $ cat > .hg/hgrc << '__EOF__'
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
226 > [hooks]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
227 > pretxncommit.test-saving-last-message =
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
228 > __EOF__
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
229
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
230 then, test editing custom commit message
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
231
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
232 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
233 amending changeset 5f357c7560ab
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
234 copying changeset 5f357c7560ab to ad120869acf0
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
235 no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
236
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
237
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
238 HG: Enter commit message. Lines beginning with 'HG:' are removed.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
239 HG: Leave message empty to abort commit.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
240 HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
241 HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
242 HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
243 HG: changed a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
244 a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
245 stripping amended changeset 5f357c7560ab
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
246 1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
247 uncompressed size of bundle content:
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
248 238 (changelog)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
249 143 (manifests)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
250 111 a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
251 saved backup bundle to $TESTTMP/.hg/strip-backup/5f357c7560ab-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
252 1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
253 uncompressed size of bundle content:
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
254 246 (changelog)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
255 143 (manifests)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
256 111 a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
257 adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
258 adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
259 adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
260 adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
261 added 1 changesets with 1 changes to 1 files
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
262 committed changeset 1:7ab3bf440b54
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
263
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
264 Same, but with changes in working dir (different code path):
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
265
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
266 $ echo a >> a
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
267 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
268 amending changeset 7ab3bf440b54
17473
9732473aa24b amend: use an explicit commit message for temporary amending commit
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17462
diff changeset
269 a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
270 copying changeset a0ea9b1a4c8c to ad120869acf0
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
271 another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
272
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
273
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
274 HG: Enter commit message. Lines beginning with 'HG:' are removed.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
275 HG: Leave message empty to abort commit.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
276 HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
277 HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
278 HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
279 HG: changed a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
280 a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
281 stripping intermediate changeset a0ea9b1a4c8c
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
282 stripping amended changeset 7ab3bf440b54
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
283 2 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
284 uncompressed size of bundle content:
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
285 450 (changelog)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
286 282 (manifests)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
287 209 a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
288 saved backup bundle to $TESTTMP/.hg/strip-backup/7ab3bf440b54-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
289 1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
290 uncompressed size of bundle content:
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
291 246 (changelog)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
292 143 (manifests)
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
293 113 a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
294 adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
295 adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
296 adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
297 adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
298 added 1 changesets with 1 changes to 1 files
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
299 committed changeset 1:ea22a388757c
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
300
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
301 $ rm editor.sh
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
302 $ hg log -r .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
303 changeset: 1:ea22a388757c
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
304 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
305 user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
306 date: Thu Jan 01 00:00:01 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
307 summary: another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
308
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
309
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
310 Moving bookmarks, preserve active bookmark:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
311
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
312 $ hg book book1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
313 $ hg book book2
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
314 $ hg ci --amend -m 'move bookmarks'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
315 saved backup bundle to $TESTTMP/.hg/strip-backup/ea22a388757c-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
316 $ hg book
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
317 book1 1:6cec5aa930e2
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
318 * book2 1:6cec5aa930e2
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
319 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
320 $ hg ci --amend -m 'move bookmarks'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
321 saved backup bundle to $TESTTMP/.hg/strip-backup/6cec5aa930e2-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
322 $ hg book
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
323 book1 1:48bb6e53a15f
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
324 * book2 1:48bb6e53a15f
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
325
18198
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
326 abort does not loose bookmarks
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
327
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
328 $ cat > editor.sh << '__EOF__'
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
329 > #!/bin/sh
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
330 > echo "" > "$1"
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
331 > __EOF__
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
332 $ echo a >> a
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
333 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
334 transaction abort!
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
335 rollback completed
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
336 abort: empty commit message
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
337 [255]
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
338 $ hg book
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
339 book1 1:48bb6e53a15f
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
340 * book2 1:48bb6e53a15f
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
341 $ hg revert -Caq
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
342 $ rm editor.sh
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
343
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
344 $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
345 $ echo "commit=-d '0 0'" >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
346
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
347 Moving branches:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
348
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
349 $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
350 marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
351 (branches are permanent and global, did you want a bookmark?)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
352 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
353 $ hg ci -m 'branch foo'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
354 $ hg branch default -f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
355 marked working directory as branch default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
356 (branches are permanent and global, did you want a bookmark?)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
357 $ hg ci --amend -m 'back to default'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
358 saved backup bundle to $TESTTMP/.hg/strip-backup/8ac881fbf49d-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
359 $ hg branches
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
360 default 2:ce12b0b57d46
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
361
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
362 Close branch:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
363
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
364 $ hg up -q 0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
365 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
366 $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
367 marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
368 (branches are permanent and global, did you want a bookmark?)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
369 $ hg ci -Am 'fork'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
370 adding b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
371 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
372 $ hg ci -mb
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
373 $ hg ci --amend --close-branch -m 'closing branch foo'
16900
3f1a153daadb tests: glob the remaining 'saved backup bundle to' to prepare for windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16745
diff changeset
374 saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
375
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
376 Same thing, different code path:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
377
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
378 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
379 $ hg ci -m 'reopen branch'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
380 reopening closed branch head 4
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
381 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
382 $ hg ci --amend --close-branch
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
383 saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
384 $ hg branches
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
385 default 2:ce12b0b57d46
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
386
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
387 Refuse to amend during a merge:
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
388
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
389 $ hg up -q default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
390 $ hg merge foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
391 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
392 (branch merge, don't forget to commit)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
393 $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
394 abort: cannot amend while merging
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
395 [255]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
396 $ hg ci -m 'merge'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
397
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
398 Follow copies/renames:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
399
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
400 $ hg mv b c
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
401 $ hg ci -m 'b -> c'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
402 $ hg mv c d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
403 $ hg ci --amend -m 'b -> d'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
404 saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-amend-backup.hg (glob)
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
405 $ hg st --rev '.^' --copies d
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
406 A d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
407 b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
408 $ hg cp d e
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
409 $ hg ci -m 'e = d'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
410 $ hg cp e f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
411 $ hg ci --amend -m 'f = d'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
412 saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-amend-backup.hg (glob)
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
413 $ hg st --rev '.^' --copies f
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
414 A f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
415 d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
416
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
417 $ mv f f.orig
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
418 $ hg rm -A f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
419 $ hg ci -m removef
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
420 $ hg cp a f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
421 $ mv f.orig f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
422 $ hg ci --amend -m replacef
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
423 saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-amend-backup.hg (glob)
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
424 $ hg st --change . --copies
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
425 $ hg log -r . --template "{file_copies}\n"
16553
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
426
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
427
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
428 Move added file (issue3410):
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
429
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
430 $ echo g >> g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
431 $ hg ci -Am g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
432 adding g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
433 $ hg mv g h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
434 $ hg ci --amend
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
435 saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-amend-backup.hg (glob)
16553
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
436 $ hg st --change . --copies h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
437 A h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
438 $ hg log -r . --template "{file_copies}\n"
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
439
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
440
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
441 Can't rollback an amend:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
442
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
443 $ hg rollback
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
444 no rollback information available
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
445 [1]
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
446
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
447 Preserve extra dict (issue3430):
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
448
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
449 $ hg branch a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
450 marked working directory as branch a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
451 (branches are permanent and global, did you want a bookmark?)
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
452 $ echo a >> a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
453 $ hg ci -ma
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
454 $ hg ci --amend -m "a'"
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
455 saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-amend-backup.hg (glob)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
456 $ hg log -r . --template "{branch}\n"
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
457 a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
458 $ hg ci --amend -m "a''"
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
459 saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-amend-backup.hg (glob)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
460 $ hg log -r . --template "{branch}\n"
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
461 a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
462
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
463 Also preserve other entries in the dict that are in the old commit,
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
464 first graft something so there's an additional entry:
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
465
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
466 $ hg up 0 -q
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
467 $ echo z > z
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
468 $ hg ci -Am 'fork'
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
469 adding z
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
470 created new head
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
471 $ hg up 11
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
472 5 files updated, 0 files merged, 1 files removed, 0 files unresolved
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
473 $ hg graft 12
23505
bd5dbb8a05c8 graft: show more useful status information while grafting
Mads Kiilerich <madski@unity3d.com>
parents: 23139
diff changeset
474 grafting 12:2647734878ef "fork" (tip)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
475 $ hg ci --amend -m 'graft amend'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
476 saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
477 $ hg log -r . --debug | grep extra
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
478 extra: amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
479 extra: branch=a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
480 extra: source=2647734878ef0236dda712fae9c1651cf694ea8a
17461
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
481
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
482 Preserve phase
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
483
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
484 $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
485 11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
486 13: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
487 $ hg phase --secret --force .
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
488 $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
489 11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
490 13: secret
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
491 $ hg commit --amend -m 'amend for phase' -q
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
492 $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
493 11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
494 13: secret
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
495
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
496 Test amend with obsolete
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
497 ---------------------------
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
498
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
499 Enable obsolete
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
500
22956
a0f89c852a0c obsolete: update test-commit-amend to use obsolete option
Durham Goode <durham@fb.com>
parents: 22249
diff changeset
501 $ cat >> $HGRCPATH << EOF
a0f89c852a0c obsolete: update test-commit-amend to use obsolete option
Durham Goode <durham@fb.com>
parents: 22249
diff changeset
502 > [experimental]
a0f89c852a0c obsolete: update test-commit-amend to use obsolete option
Durham Goode <durham@fb.com>
parents: 22249
diff changeset
503 > evolution=createmarkers,allowunstable
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
504 > EOF
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
505
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
506 Amend with no files changes
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
507
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
508 $ hg id -n
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
509 13
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
510 $ hg ci --amend -m 'babar'
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
511 $ hg id -n
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
512 14
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
513 $ hg log -Gl 3 --style=compact
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
514 @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
515 | babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
516 |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
517 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
518 | | fork
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
519 | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
520 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
521 | | a''
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
522 | |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
523 $ hg log -Gl 4 --hidden --style=compact
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
524 @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
525 | babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
526 |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
527 | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
528 |/ amend for phase
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
529 |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
530 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
531 | | fork
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
532 | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
533 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
534 | | a''
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
535 | |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
536
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
537 Amend with files changes
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
538
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
539 (note: the extra commit over 15 is a temporary junk I would be happy to get
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
540 ride of)
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
541
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
542 $ echo 'babar' >> a
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
543 $ hg commit --amend
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
544 $ hg log -Gl 6 --hidden --style=compact
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
545 @ 16[tip]:11 9f9e9bccf56c 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
546 | babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
547 |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
548 | x 15 90fef497c56f 1970-01-01 00:00 +0000 test
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
549 | | temporary amend commit for b650e6ee8614
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
550 | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
551 | x 14:11 b650e6ee8614 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
552 |/ babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
553 |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
554 | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
555 |/ amend for phase
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
556 |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
557 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
558 | | fork
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
559 | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
560 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
561 | | a''
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
562 | |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
563
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
564
18399
66cec3c2ee00 tests: more comment cleanup related to obsolescence
Kevin Bullock <kbullock@ringworld.org>
parents: 18398
diff changeset
565 Test that amend does not make it easy to create obsolescence cycle
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
566 ---------------------------------------------------------------------
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
567
18267
5bb610f87d1d clfilter: enforce hidden changeset globally
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18206
diff changeset
568 $ hg id -r 14 --hidden
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
569 b650e6ee8614 (a)
18267
5bb610f87d1d clfilter: enforce hidden changeset globally
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18206
diff changeset
570 $ hg revert -ar 14 --hidden
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
571 reverting a
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
572 $ hg commit --amend
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
573 $ hg id
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
574 b99e5df575f7 (a) tip
18163
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
575
18398
1a00c8451640 test: fix in-test comments related to obsolescence
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18267
diff changeset
576 Test that rewriting leaving instability behind is allowed
18163
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
577 ---------------------------------------------------------------------
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
578
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
579 $ hg up '.^'
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
580 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
581 $ echo 'b' >> a
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
582 $ hg log --style compact -r 'children(.)'
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
583 18[tip]:11 b99e5df575f7 1970-01-01 00:00 +0000 test
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
584 babar
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
585
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
586 $ hg commit --amend
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
587 $ hg log -r 'unstable()'
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
588 changeset: 18:b99e5df575f7
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
589 branch: a
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
590 parent: 11:3334b7925910
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
591 user: test
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
592 date: Thu Jan 01 00:00:00 1970 +0000
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
593 summary: babar
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
594
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
595
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
596 Amend a merge changeset (with renames and conflicts from the second parent):
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
597
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
598 $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
599 $ hg branch -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
600 $ hg cp a aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
601 $ hg mv z zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
602 $ echo cc > cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
603 $ hg add cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
604 $ hg ci -m aazzcc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
605 $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
606 $ echo a >> a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
607 $ echo dd > cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
608 $ hg add cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
609 $ hg ci -m aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
610 $ hg merge -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
611 warning: conflicts during merge.
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
612 merging cc incomplete! (edit conflicts, then use 'hg resolve --mark')
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
613 [1]
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
614 $ hg resolve -m cc
21947
b081decd9062 resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
615 (no more unresolved files)
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
616 $ hg ci -m 'merge bar'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
617 $ hg log --config diff.git=1 -pr .
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
618 changeset: 23:93cd4445f720
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
619 tag: tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
620 parent: 22:30d96aeaf27b
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
621 parent: 21:1aa437659d19
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
622 user: test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
623 date: Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
624 summary: merge bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
625
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
626 diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
627 copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
628 copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
629 diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
630 --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
631 +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
632 @@ -1,1 +1,5 @@
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
633 +<<<<<<< local: 30d96aeaf27b - test: aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
634 dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
635 +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
636 +cc
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
637 +>>>>>>> other: 1aa437659d19 bar - test: aazzcc
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
638 diff --git a/z b/zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
639 rename from z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
640 rename to zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
641
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
642 $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
643 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
644 $ hg debugrename zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
645 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
646 $ hg debugrename cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
647 cc not renamed
22249
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
648 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
649 HGEDITFORM=commit.amend.merge
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
650 $ hg log --config diff.git=1 -pr .
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
651 changeset: 24:832b50f2c271
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
652 tag: tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
653 parent: 22:30d96aeaf27b
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
654 parent: 21:1aa437659d19
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
655 user: test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
656 date: Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
657 summary: merge bar (amend message)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
658
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
659 diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
660 copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
661 copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
662 diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
663 --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
664 +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
665 @@ -1,1 +1,5 @@
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
666 +<<<<<<< local: 30d96aeaf27b - test: aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
667 dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
668 +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
669 +cc
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
670 +>>>>>>> other: 1aa437659d19 bar - test: aazzcc
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
671 diff --git a/z b/zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
672 rename from z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
673 rename to zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
674
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
675 $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
676 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
677 $ hg debugrename zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
678 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
679 $ hg debugrename cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
680 cc not renamed
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
681 $ hg mv zz z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
682 $ hg ci --amend -m 'merge bar (undo rename)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
683 $ hg log --config diff.git=1 -pr .
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
684 changeset: 26:bdafc5c72f74
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
685 tag: tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
686 parent: 22:30d96aeaf27b
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
687 parent: 21:1aa437659d19
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
688 user: test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
689 date: Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
690 summary: merge bar (undo rename)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
691
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
692 diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
693 copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
694 copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
695 diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
696 --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
697 +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
698 @@ -1,1 +1,5 @@
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
699 +<<<<<<< local: 30d96aeaf27b - test: aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
700 dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
701 +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
702 +cc
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
703 +>>>>>>> other: 1aa437659d19 bar - test: aazzcc
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
704
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
705 $ hg debugrename z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
706 z not renamed
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
707
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
708 Amend a merge changeset (with renames during the merge):
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
709
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
710 $ hg up -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
711 $ echo x > x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
712 $ hg add x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
713 $ hg ci -m x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
714 $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
715 $ hg merge -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
716 $ hg mv aa aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
717 $ echo aa >> aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
718 $ hg ci -m 'merge bar again'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
719 $ hg log --config diff.git=1 -pr .
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
720 changeset: 28:32f19415b634
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
721 tag: tip
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
722 parent: 26:bdafc5c72f74
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
723 parent: 27:4c94d5bc65f5
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
724 user: test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
725 date: Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
726 summary: merge bar again
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
727
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
728 diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
729 deleted file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
730 --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
731 +++ /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
732 @@ -1,2 +0,0 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
733 -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
734 -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
735 diff --git a/aaa b/aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
736 new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
737 --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
738 +++ b/aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
739 @@ -0,0 +1,3 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
740 +a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
741 +a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
742 +aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
743 diff --git a/x b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
744 new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
745 --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
746 +++ b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
747 @@ -0,0 +1,1 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
748 +x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
749
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
750 $ hg debugrename aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
751 aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
752 $ hg mv aaa aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
753 $ hg ci --amend -m 'merge bar again (undo rename)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
754 $ hg log --config diff.git=1 -pr .
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
755 changeset: 30:1e2a06b3d312
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
756 tag: tip
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
757 parent: 26:bdafc5c72f74
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
758 parent: 27:4c94d5bc65f5
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
759 user: test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
760 date: Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
761 summary: merge bar again (undo rename)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
762
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
763 diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
764 --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
765 +++ b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
766 @@ -1,2 +1,3 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
767 a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
768 a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
769 +aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
770 diff --git a/x b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
771 new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
772 --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
773 +++ b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
774 @@ -0,0 +1,1 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
775 +x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
776
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
777 $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
778 aa not renamed
18912
4e1ae55e63ef test-commit-amend.t: fix check-code violation from 3a72c89a83ec
Augie Fackler <raf@durin42.com>
parents: 18909
diff changeset
779 $ hg debugrename -r '.^' aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
780 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
781
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
782 Amend a merge changeset (with manifest-level conflicts):
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
783
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
784 $ hg up -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
785 $ hg rm aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
786 $ hg ci -m 'rm aa'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
787 $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
788 $ echo aa >> aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
789 $ hg ci -m aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
790 $ hg merge -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
791 local changed aa which remote deleted
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
792 use (c)hanged version or (d)elete? c
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
793 $ hg ci -m 'merge bar (with conflicts)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
794 $ hg log --config diff.git=1 -pr .
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
795 changeset: 33:97a298b0c59f
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
796 tag: tip
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
797 parent: 32:3d78ce4226b8
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
798 parent: 31:67db8847a540
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
799 user: test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
800 date: Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
801 summary: merge bar (with conflicts)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
802
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
803
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
804 $ hg rm aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
805 $ hg ci --amend -m 'merge bar (with conflicts, amended)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
806 $ hg log --config diff.git=1 -pr .
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
807 changeset: 35:6de0c1bde1c8
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
808 tag: tip
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21519
diff changeset
809 parent: 32:3d78ce4226b8
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
810 parent: 31:67db8847a540
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
811 user: test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
812 date: Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
813 summary: merge bar (with conflicts, amended)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
814
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
815 diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
816 deleted file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
817 --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
818 +++ /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
819 @@ -1,4 +0,0 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
820 -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
821 -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
822 -aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
823 -aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
824
19305
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
825 Issue 3445: amending with --close-branch a commit that created a new head should fail
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
826 This shouldn't be possible:
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
827
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
828 $ hg up -q default
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
829 $ hg branch closewithamend
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
830 marked working directory as branch closewithamend
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
831 (branches are permanent and global, did you want a bookmark?)
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
832 $ echo foo > foo
22956
a0f89c852a0c obsolete: update test-commit-amend to use obsolete option
Durham Goode <durham@fb.com>
parents: 22249
diff changeset
833 $ hg add foo
19980
0151b61fed97 test: do not add .pyc and .orig in test-commit-amend.t (issue4085)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19305
diff changeset
834 $ hg ci -m..
19305
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
835 $ hg ci --amend --close-branch -m 'closing'
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
836 abort: can only close branch heads
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
837 [255]
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
838
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
839 This silliness fails:
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
840
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
841 $ hg branch silliness
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
842 marked working directory as branch silliness
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
843 (branches are permanent and global, did you want a bookmark?)
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
844 $ echo b >> b
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
845 $ hg ci --close-branch -m'open and close'
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
846 abort: can only close branch heads
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
847 [255]
20700
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
848
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
849 Test that amend with --secret creates new secret changeset forcibly
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
850 ---------------------------------------------------------------------
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
851
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
852 $ hg phase '.^::.'
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
853 35: draft
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
854 36: draft
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
855 $ hg commit --amend --secret -m 'amend as secret' -q
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
856 $ hg phase '.^::.'
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
857 35: draft
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
858 38: secret
21036
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
859
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
860 Test that amend with --edit invokes editor forcibly
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
861 ---------------------------------------------------
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
862
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
863 $ hg parents --template "{desc}\n"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
864 amend as secret
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
865 $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
866 $ hg parents --template "{desc}\n"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
867 editor should be suppressed
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
868
23587
8063901e56cd memctx: calculate exact status being committed from specified files
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23505
diff changeset
869 $ hg status --rev '.^1::.'
8063901e56cd memctx: calculate exact status being committed from specified files
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23505
diff changeset
870 A foo
21036
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
871 $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
872 editor should be invoked
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
873
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
874
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
875 HG: Enter commit message. Lines beginning with 'HG:' are removed.
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
876 HG: Leave message empty to abort commit.
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
877 HG: --
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
878 HG: user: test
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
879 HG: branch 'silliness'
23587
8063901e56cd memctx: calculate exact status being committed from specified files
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23505
diff changeset
880 HG: added foo
21036
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
881 $ hg parents --template "{desc}\n"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
882 editor should be invoked
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
883
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
884 Test that "diff()" in committemplate works correctly for amending
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
885 -----------------------------------------------------------------
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
886
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
887 $ cat >> .hg/hgrc <<EOF
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
888 > [committemplate]
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
889 > changeset.commit.amend = {desc}\n
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
890 > HG: M: {file_mods}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
891 > HG: A: {file_adds}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
892 > HG: R: {file_dels}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
893 > {splitlines(diff()) % 'HG: {line}\n'}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
894 > EOF
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
895
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
896 $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
897 M:
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
898 A: foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
899 R:
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
900 $ hg status -amr
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
901 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo"
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
902 expecting diff of foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
903
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
904 HG: M:
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
905 HG: A: foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
906 HG: R:
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
907 HG: diff -r 6de0c1bde1c8 foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
908 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
909 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
910 HG: @@ -0,0 +1,1 @@
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
911 HG: +foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
912
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
913 $ echo y > y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
914 $ hg add y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
915 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y"
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
916 expecting diff of foo and y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
917
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
918 HG: M:
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
919 HG: A: foo y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
920 HG: R:
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
921 HG: diff -r 6de0c1bde1c8 foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
922 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
923 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
924 HG: @@ -0,0 +1,1 @@
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
925 HG: +foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
926 HG: diff -r 6de0c1bde1c8 y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
927 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
928 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
929 HG: @@ -0,0 +1,1 @@
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
930 HG: +y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
931
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
932 $ hg rm a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
933 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y"
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
934 expecting diff of a, foo and y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
935
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
936 HG: M:
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
937 HG: A: foo y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
938 HG: R: a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
939 HG: diff -r 6de0c1bde1c8 a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
940 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
941 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
942 HG: @@ -1,2 +0,0 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
943 HG: -a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
944 HG: -a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
945 HG: diff -r 6de0c1bde1c8 foo
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
946 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
947 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
948 HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
949 HG: +foo
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
950 HG: diff -r 6de0c1bde1c8 y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
951 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
952 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
953 HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
954 HG: +y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
955
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
956 $ hg rm x
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
957 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y"
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
958 expecting diff of a, foo, x and y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
959
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
960 HG: M:
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
961 HG: A: foo y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
962 HG: R: a x
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
963 HG: diff -r 6de0c1bde1c8 a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
964 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
965 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
966 HG: @@ -1,2 +0,0 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
967 HG: -a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
968 HG: -a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
969 HG: diff -r 6de0c1bde1c8 foo
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
970 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
971 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
972 HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
973 HG: +foo
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
974 HG: diff -r 6de0c1bde1c8 x
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
975 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
976 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
977 HG: @@ -1,1 +0,0 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
978 HG: -x
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
979 HG: diff -r 6de0c1bde1c8 y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
980 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
981 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
982 HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
983 HG: +y
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
984
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
985 Check for issue4405
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
986 -------------------
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
987
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
988 Setup the repo with a file that gets moved in a second commit.
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
989 $ hg init repo
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
990 $ cd repo
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
991 $ touch a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
992 $ hg add a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
993 $ hg commit -m a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
994 $ hg mv a0 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
995 $ hg commit -m a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
996 $ hg up -q 0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
997 $ hg log -G --template '{rev} {desc}'
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
998 o 1 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
999 |
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1000 @ 0 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1001
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1002
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1003 Now we branch the repro, but re-use the file contents, so we have a divergence
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1004 in the file revlog topology and the changelog topology.
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1005 $ hg revert --rev 1 --all
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1006 removing a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1007 adding a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1008 $ hg ci -qm 'a1-amend'
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1009 $ hg log -G --template '{rev} {desc}'
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1010 @ 2 a1-amend
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1011 |
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1012 | o 1 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1013 |/
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1014 o 0 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1015
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1016
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1017 The way mercurial does amends is to create a temporary commit (rev 3) and then
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1018 fold the new and old commits together into another commit (rev 4). During this
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23071
diff changeset
1019 process, _findlimit is called to check how far back to look for the transitive
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1020 closure of file copy information, but due to the divergence of the filelog
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23071
diff changeset
1021 and changelog graph topologies, before _findlimit was fixed, it returned a rev
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1022 which was not far enough back in this case.
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1023 $ hg mv a1 a2
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1024 $ hg status --copies --rev 0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1025 A a2
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1026 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1027 R a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1028 $ hg ci --amend -q
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1029 $ hg log -G --template '{rev} {desc}'
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1030 @ 4 a1-amend
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1031 |
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1032 | o 1 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1033 |/
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1034 o 0 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1035
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1036
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1037 Before the fix, the copy information was lost.
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1038 $ hg status --copies --rev 0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1039 A a2
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1040 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
1041 R a0