|
1 $ . "$TESTDIR/histedit-helpers.sh" |
|
2 |
|
3 $ cat >> $HGRCPATH <<EOF |
|
4 > [extensions] |
|
5 > graphlog= |
|
6 > histedit= |
|
7 > EOF |
|
8 |
|
9 $ EDITED=`pwd`/editedhistory |
|
10 $ cat > $EDITED <<EOF |
|
11 > pick 177f92b77385 c |
|
12 > pick 055a42cdd887 d |
|
13 > fold bfa474341cc9 does not commute with e |
|
14 > pick e860deea161a e |
|
15 > pick 652413bf663e f |
|
16 > EOF |
|
17 $ initrepo () |
|
18 > { |
|
19 > hg init $1 |
|
20 > cd $1 |
|
21 > for x in a b c d e f ; do |
|
22 > echo $x > $x |
|
23 > hg add $x |
|
24 > hg ci -m $x |
|
25 > done |
|
26 > echo a >> e |
|
27 > hg ci -m 'does not commute with e' |
|
28 > cd .. |
|
29 > } |
|
30 |
|
31 $ initrepo r |
|
32 $ cd r |
|
33 |
|
34 log before edit |
|
35 $ hg log --graph |
|
36 @ changeset: 6:bfa474341cc9 |
|
37 | tag: tip |
|
38 | user: test |
|
39 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | summary: does not commute with e |
|
41 | |
|
42 o changeset: 5:652413bf663e |
|
43 | user: test |
|
44 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | summary: f |
|
46 | |
|
47 o changeset: 4:e860deea161a |
|
48 | user: test |
|
49 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | summary: e |
|
51 | |
|
52 o changeset: 3:055a42cdd887 |
|
53 | user: test |
|
54 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | summary: d |
|
56 | |
|
57 o changeset: 2:177f92b77385 |
|
58 | user: test |
|
59 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | summary: c |
|
61 | |
|
62 o changeset: 1:d2ae7f538514 |
|
63 | user: test |
|
64 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
65 | summary: b |
|
66 | |
|
67 o changeset: 0:cb9a9f314b8b |
|
68 user: test |
|
69 date: Thu Jan 01 00:00:00 1970 +0000 |
|
70 summary: a |
|
71 |
|
72 |
|
73 edit the history |
|
74 $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle |
|
75 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
76 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
77 abort: Fix up the change and run hg histedit --continue |
|
78 |
|
79 fix up |
|
80 $ echo a > e |
|
81 $ hg add e |
|
82 $ cat > cat.py <<EOF |
|
83 > import sys |
|
84 > print open(sys.argv[1]).read() |
|
85 > print |
|
86 > print |
|
87 > EOF |
|
88 $ HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed' |
|
89 d |
|
90 *** |
|
91 does not commute with e |
|
92 |
|
93 |
|
94 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
95 file e already exists |
|
96 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
97 abort: Fix up the change and run hg histedit --continue |
|
98 |
|
99 just continue this time |
|
100 $ hg histedit --continue 2>&1 | fixbundle |
|
101 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
103 |
|
104 log after edit |
|
105 $ hg log --graph |
|
106 @ changeset: 4:f768fd60ca34 |
|
107 | tag: tip |
|
108 | user: test |
|
109 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
110 | summary: f |
|
111 | |
|
112 o changeset: 3:671efe372e33 |
|
113 | user: test |
|
114 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
115 | summary: d |
|
116 | |
|
117 o changeset: 2:177f92b77385 |
|
118 | user: test |
|
119 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
120 | summary: c |
|
121 | |
|
122 o changeset: 1:d2ae7f538514 |
|
123 | user: test |
|
124 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
125 | summary: b |
|
126 | |
|
127 o changeset: 0:cb9a9f314b8b |
|
128 user: test |
|
129 date: Thu Jan 01 00:00:00 1970 +0000 |
|
130 summary: a |
|
131 |
|
132 |
|
133 contents of e |
|
134 $ hg cat e |
|
135 a |
|
136 |
|
137 manifest |
|
138 $ hg manifest |
|
139 a |
|
140 b |
|
141 c |
|
142 d |
|
143 e |
|
144 f |
|
145 |
|
146 $ cd .. |