annotate tests/test-commit-amend.t @ 16483:3c4910364797 stable

tests: ^ must be quoted when used on solaris sh The check was broken when it was introduced in 6e4cf8319f54.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 23 Apr 2012 01:39:26 +0200
parents 55982f62651f
children 249542ded278
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
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
26 Amending changeset with changes in working dir:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
28 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
29 $ hg ci --amend -m 'amend base1'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
30 saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
31 $ hg diff -c .
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
32 diff -r ad120869acf0 -r 9cd25b479c51 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
33 --- 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
34 +++ 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
35 @@ -1,1 +1,3 @@
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
36 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
37 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
38 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
39 $ hg log
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
40 changeset: 1:9cd25b479c51
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
41 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
42 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
43 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
44 summary: amend base1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
45
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
46 changeset: 0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
47 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
48 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
49 summary: base
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
50
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
51
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
52 Add new file:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
53
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
54 $ echo b > b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
55 $ hg ci --amend -Am 'amend base1 new file'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
56 adding b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
57 saved backup bundle to $TESTTMP/.hg/strip-backup/9cd25b479c51-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
58
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
59 Remove file that was added in amended commit:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
60
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
61 $ hg rm b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
62 $ hg ci --amend -m 'amend base1 remove new file'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
63 saved backup bundle to $TESTTMP/.hg/strip-backup/e2bb3ecffd2f-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
64
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
65 $ hg cat b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
66 b: no such file in rev 664a9b2d60cd
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
67 [1]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
68
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
69 No changes, just a different message:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
70
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
71 $ hg ci -v --amend -m 'no changes, new message'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
72 amending changeset 664a9b2d60cd
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
73 copying changeset 664a9b2d60cd to ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
74 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
75 stripping amended changeset 664a9b2d60cd
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
76 1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
77 saved backup bundle to $TESTTMP/.hg/strip-backup/664a9b2d60cd-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
78 1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
79 adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
80 adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
81 adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
82 adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
83 added 1 changesets with 1 changes to 1 files
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
84 committed changeset 1:ea6e356ff2ad
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
85 $ hg diff -c .
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
86 diff -r ad120869acf0 -r ea6e356ff2ad a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
87 --- 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
88 +++ 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
89 @@ -1,1 +1,3 @@
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
90 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
91 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
92 +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
93 $ hg log
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
94 changeset: 1:ea6e356ff2ad
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
95 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
96 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
97 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
98 summary: no changes, new message
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 changeset: 0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
101 user: test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
102 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
103 summary: base
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
104
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 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
107
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
108 $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
109 $ echo 'commit=' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
110
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
111 Test -u/-d:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
112
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
113 $ hg ci --amend -u foo -d '1 0'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
114 saved backup bundle to $TESTTMP/.hg/strip-backup/ea6e356ff2ad-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
115 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
116 $ hg ci --amend -u foo -d '1 0'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
117 saved backup bundle to $TESTTMP/.hg/strip-backup/377b91ce8b56-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
118 $ hg log -r .
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
119 changeset: 1:2c94e4a5756f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
120 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
121 user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
122 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
123 summary: no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
124
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
125
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
126 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
127
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
128 $ cat > editor << '__EOF__'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
129 > #!/bin/sh
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
130 > cat $1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
131 > echo "another precious commit message" > "$1"
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
132 > __EOF__
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
133 $ chmod +x editor
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
134 $ HGEDITOR="'`pwd`'"/editor hg commit --amend -v
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
135 amending changeset 2c94e4a5756f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
136 copying changeset 2c94e4a5756f to ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
137 no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
138
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
139
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
140 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
141 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
142 HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
143 HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
144 HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
145 HG: changed a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
146 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
147 stripping amended changeset 2c94e4a5756f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
148 1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
149 saved backup bundle to $TESTTMP/.hg/strip-backup/2c94e4a5756f-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
150 1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
151 adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
152 adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
153 adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
154 adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
155 added 1 changesets with 1 changes to 1 files
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
156 committed changeset 1:ffb49186f961
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
157
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
158 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
159
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
160 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
161 $ HGEDITOR="'`pwd`'"/editor hg commit --amend -v
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
162 amending changeset ffb49186f961
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
163 another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
164
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
165
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
166 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
167 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
168 HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
169 HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
170 HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
171 HG: changed a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
172 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
173 copying changeset 27f3aacd3011 to ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
174 a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
175 stripping intermediate changeset 27f3aacd3011
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
176 stripping amended changeset ffb49186f961
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
177 2 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
178 saved backup bundle to $TESTTMP/.hg/strip-backup/ffb49186f961-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
179 1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
180 adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
181 adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
182 adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
183 adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
184 added 1 changesets with 1 changes to 1 files
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
185 committed changeset 1:fb6cca43446f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
186
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
187 $ rm editor
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
188 $ hg log -r .
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
189 changeset: 1:fb6cca43446f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
190 tag: tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
191 user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
192 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
193 summary: another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
194
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
195
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
196 Moving bookmarks, preserve active bookmark:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
197
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
198 $ hg book book1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
199 $ hg book book2
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
200 $ hg ci --amend -m 'move bookmarks'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
201 saved backup bundle to $TESTTMP/.hg/strip-backup/fb6cca43446f-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
202 $ hg book
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
203 book1 1:0cf1c7a51bcf
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
204 * book2 1:0cf1c7a51bcf
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
205 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
206 $ hg ci --amend -m 'move bookmarks'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
207 saved backup bundle to $TESTTMP/.hg/strip-backup/0cf1c7a51bcf-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
208 $ hg book
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
209 book1 1:7344472bd951
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
210 * book2 1:7344472bd951
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
211
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
212 $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
213 $ echo "commit=-d '0 0'" >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
214
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
215 Moving branches:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
216
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
217 $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
218 marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
219 (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
220 $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
221 $ hg ci -m 'branch foo'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
222 $ hg branch default -f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
223 marked working directory as branch default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
224 (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
225 $ hg ci --amend -m 'back to default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
226 saved backup bundle to $TESTTMP/.hg/strip-backup/1661ca36a2db-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
227 $ hg branches
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
228 default 2:f24ee5961967
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
229
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
230 Close branch:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
231
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
232 $ hg up -q 0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
233 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
234 $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
235 marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
236 (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
237 $ hg ci -Am 'fork'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
238 adding b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
239 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
240 $ hg ci -mb
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
241 $ hg ci --amend --close-branch -m 'closing branch foo'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
242 saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
243
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
244 Same thing, different code path:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
245
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
246 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
247 $ hg ci -m 'reopen branch'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
248 reopening closed branch head 4
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
249 $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
250 $ hg ci --amend --close-branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
251 saved backup bundle to $TESTTMP/.hg/strip-backup/5e302dcc12b8-amend-backup.hg
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
252 $ hg branches
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
253 default 2:f24ee5961967
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
254
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
255 Refuse to amend merges:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
256
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
257 $ hg up -q default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
258 $ hg merge foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
259 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
260 (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
261 $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
262 abort: cannot amend while merging
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
263 [255]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
264 $ hg ci -m 'merge'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
265 $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
266 abort: cannot amend merge changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
267 [255]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
268
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
269 Follow copies/renames:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
270
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
271 $ hg mv b c
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
272 $ hg ci -m 'b -> c'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
273 $ hg mv c d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
274 $ hg ci --amend -m 'b -> d'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
275 saved backup bundle to $TESTTMP/.hg/strip-backup/9c207120aa98-amend-backup.hg
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
276 $ hg st --rev '.^' --copies d
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
277 A d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
278 b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
279 $ hg cp d e
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
280 $ hg ci -m 'e = d'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
281 $ hg cp e f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
282 $ hg ci --amend -m 'f = d'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
283 saved backup bundle to $TESTTMP/.hg/strip-backup/fda2b3b27b22-amend-backup.hg
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
284 $ hg st --rev '.^' --copies f
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
285 A f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
286 d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
287
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
288 Can't rollback an amend:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
289
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
290 $ hg rollback
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
291 no rollback information available
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
292 [1]