Mercurial > hg
comparison tests/test-histedit-bookmark-motion.t @ 17064:168cc52ad7c2
histedit: new extension for interactive history editing
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Wed, 27 Jun 2012 17:52:54 -0500 |
parents | |
children | 949e241b5573 |
comparison
equal
deleted
inserted
replaced
17063:3fbc6e3abdbd | 17064:168cc52ad7c2 |
---|---|
1 $ . "$TESTDIR/histedit-helpers.sh" | |
2 | |
3 $ cat >> $HGRCPATH <<EOF | |
4 > [extensions] | |
5 > graphlog= | |
6 > histedit= | |
7 > EOF | |
8 | |
9 $ hg init r | |
10 $ cd r | |
11 See if bookmarks are in core. If not, then we don't support bookmark | |
12 motion on this version of hg. | |
13 $ hg bookmarks || exit 80 | |
14 no bookmarks set | |
15 $ for x in a b c d e f ; do | |
16 > echo $x > $x | |
17 > hg add $x | |
18 > hg ci -m $x | |
19 > done | |
20 | |
21 $ hg book -r 1 will-move-backwards | |
22 $ hg book -r 2 two | |
23 $ hg book -r 2 also-two | |
24 $ hg book -r 3 three | |
25 $ hg book -r 4 four | |
26 $ hg book -r tip five | |
27 $ hg log --graph | |
28 @ changeset: 5:652413bf663e | |
29 | bookmark: five | |
30 | tag: tip | |
31 | user: test | |
32 | date: Thu Jan 01 00:00:00 1970 +0000 | |
33 | summary: f | |
34 | | |
35 o changeset: 4:e860deea161a | |
36 | bookmark: four | |
37 | user: test | |
38 | date: Thu Jan 01 00:00:00 1970 +0000 | |
39 | summary: e | |
40 | | |
41 o changeset: 3:055a42cdd887 | |
42 | bookmark: three | |
43 | user: test | |
44 | date: Thu Jan 01 00:00:00 1970 +0000 | |
45 | summary: d | |
46 | | |
47 o changeset: 2:177f92b77385 | |
48 | bookmark: also-two | |
49 | bookmark: two | |
50 | user: test | |
51 | date: Thu Jan 01 00:00:00 1970 +0000 | |
52 | summary: c | |
53 | | |
54 o changeset: 1:d2ae7f538514 | |
55 | bookmark: will-move-backwards | |
56 | user: test | |
57 | date: Thu Jan 01 00:00:00 1970 +0000 | |
58 | summary: b | |
59 | | |
60 o changeset: 0:cb9a9f314b8b | |
61 user: test | |
62 date: Thu Jan 01 00:00:00 1970 +0000 | |
63 summary: a | |
64 | |
65 $ HGEDITOR=cat hg histedit 1 | |
66 pick d2ae7f538514 1 b | |
67 pick 177f92b77385 2 c | |
68 pick 055a42cdd887 3 d | |
69 pick e860deea161a 4 e | |
70 pick 652413bf663e 5 f | |
71 | |
72 # Edit history between d2ae7f538514 and 652413bf663e | |
73 # | |
74 # Commands: | |
75 # p, pick = use commit | |
76 # e, edit = use commit, but stop for amending | |
77 # f, fold = use commit, but fold into previous commit (combines N and N-1) | |
78 # d, drop = remove commit from history | |
79 # m, mess = edit message without changing commit content | |
80 # | |
81 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
82 $ cat >> commands.txt <<EOF | |
83 > pick 177f92b77385 2 c | |
84 > drop d2ae7f538514 1 b | |
85 > pick 055a42cdd887 3 d | |
86 > fold e860deea161a 4 e | |
87 > pick 652413bf663e 5 f | |
88 > EOF | |
89 $ hg histedit 1 --commands commands.txt --verbose | grep histedit | |
90 histedit: Should update metadata for the following changes: | |
91 histedit: 055a42cdd887 to ae467701c500 | |
92 histedit: moving bookmarks three | |
93 histedit: 652413bf663e to 0efacef7cb48 | |
94 histedit: moving bookmarks five | |
95 histedit: d2ae7f538514 to cb9a9f314b8b | |
96 histedit: moving bookmarks will-move-backwards | |
97 histedit: e860deea161a to ae467701c500 | |
98 histedit: moving bookmarks four | |
99 histedit: 177f92b77385 to d36c0562f908 | |
100 histedit: moving bookmarks also-two, two | |
101 saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg | |
102 saved backup bundle to $TESTTMP/r/.hg/strip-backup/34a9919932c1-backup.hg | |
103 $ hg log --graph | |
104 @ changeset: 3:0efacef7cb48 | |
105 | bookmark: five | |
106 | tag: tip | |
107 | user: test | |
108 | date: Thu Jan 01 00:00:00 1970 +0000 | |
109 | summary: f | |
110 | | |
111 o changeset: 2:ae467701c500 | |
112 | bookmark: four | |
113 | bookmark: three | |
114 | user: test | |
115 | date: Thu Jan 01 00:00:00 1970 +0000 | |
116 | summary: d | |
117 | | |
118 o changeset: 1:d36c0562f908 | |
119 | bookmark: also-two | |
120 | bookmark: two | |
121 | user: test | |
122 | date: Thu Jan 01 00:00:00 1970 +0000 | |
123 | summary: c | |
124 | | |
125 o changeset: 0:cb9a9f314b8b | |
126 bookmark: will-move-backwards | |
127 user: test | |
128 date: Thu Jan 01 00:00:00 1970 +0000 | |
129 summary: a | |
130 | |
131 $ HGEDITOR=cat hg histedit 1 | |
132 pick d36c0562f908 1 c | |
133 pick ae467701c500 2 d | |
134 pick 0efacef7cb48 3 f | |
135 | |
136 # Edit history between d36c0562f908 and 0efacef7cb48 | |
137 # | |
138 # Commands: | |
139 # p, pick = use commit | |
140 # e, edit = use commit, but stop for amending | |
141 # f, fold = use commit, but fold into previous commit (combines N and N-1) | |
142 # d, drop = remove commit from history | |
143 # m, mess = edit message without changing commit content | |
144 # | |
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
146 $ cat > commands.txt << EOF | |
147 > pick d36c0562f908 1 c | |
148 > pick 0efacef7cb48 3 f | |
149 > pick ae467701c500 2 d | |
150 > EOF | |
151 $ hg histedit 1 --commands commands.txt --verbose | grep histedit | |
152 histedit: Should update metadata for the following changes: | |
153 histedit: 0efacef7cb48 to 1be9c35b4cb2 | |
154 histedit: moving bookmarks five | |
155 histedit: ae467701c500 to 1be9c35b4cb2 | |
156 histedit: moving bookmarks four, three | |
157 histedit: 0efacef7cb48 to 7c044e3e33a9 | |
158 saved backup bundle to $TESTTMP/r/.hg/strip-backup/ae467701c500-backup.hg | |
159 | |
160 We expect 'five' to stay at tip, since the tipmost bookmark is most | |
161 likely the useful signal. | |
162 | |
163 $ hg log --graph | |
164 @ changeset: 3:1be9c35b4cb2 | |
165 | bookmark: five | |
166 | bookmark: four | |
167 | bookmark: three | |
168 | tag: tip | |
169 | user: test | |
170 | date: Thu Jan 01 00:00:00 1970 +0000 | |
171 | summary: d | |
172 | | |
173 o changeset: 2:7c044e3e33a9 | |
174 | user: test | |
175 | date: Thu Jan 01 00:00:00 1970 +0000 | |
176 | summary: f | |
177 | | |
178 o changeset: 1:d36c0562f908 | |
179 | bookmark: also-two | |
180 | bookmark: two | |
181 | user: test | |
182 | date: Thu Jan 01 00:00:00 1970 +0000 | |
183 | summary: c | |
184 | | |
185 o changeset: 0:cb9a9f314b8b | |
186 bookmark: will-move-backwards | |
187 user: test | |
188 date: Thu Jan 01 00:00:00 1970 +0000 | |
189 summary: a | |
190 |