Show More
@@ -1,142 +1,142 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | Enable obsolete |
|
4 | 4 | |
|
5 | 5 | $ cat > ${TESTTMP}/obs.py << EOF |
|
6 | 6 | > import mercurial.obsolete |
|
7 | 7 | > mercurial.obsolete._enabled = True |
|
8 | 8 | > EOF |
|
9 | 9 | |
|
10 | 10 | $ cat >> $HGRCPATH << EOF |
|
11 | 11 | > [ui] |
|
12 | 12 | > logtemplate= {rev}:{node|short} {desc|firstline} |
|
13 | 13 | > [phases] |
|
14 | 14 | > publish=False |
|
15 | 15 | > [extensions]' |
|
16 | 16 | > histedit= |
|
17 | 17 | > |
|
18 | 18 | > obs=${TESTTMP}/obs.py |
|
19 | 19 | > EOF |
|
20 | 20 | |
|
21 | 21 | $ hg init base |
|
22 | 22 | $ cd base |
|
23 | 23 | |
|
24 | 24 | $ for x in a b c d e f ; do |
|
25 | 25 | > echo $x > $x |
|
26 | 26 | > hg add $x |
|
27 | 27 | > hg ci -m $x |
|
28 | 28 | > done |
|
29 | 29 | |
|
30 | 30 | $ hg log --graph |
|
31 | 31 | @ 5:652413bf663e f |
|
32 | 32 | | |
|
33 | 33 | o 4:e860deea161a e |
|
34 | 34 | | |
|
35 | 35 | o 3:055a42cdd887 d |
|
36 | 36 | | |
|
37 | 37 | o 2:177f92b77385 c |
|
38 | 38 | | |
|
39 | 39 | o 1:d2ae7f538514 b |
|
40 | 40 | | |
|
41 | 41 | o 0:cb9a9f314b8b a |
|
42 | 42 | |
|
43 | 43 | |
|
44 | 44 | $ HGEDITOR=cat hg histedit 1 |
|
45 | 45 | pick d2ae7f538514 1 b |
|
46 | 46 | pick 177f92b77385 2 c |
|
47 | 47 | pick 055a42cdd887 3 d |
|
48 | 48 | pick e860deea161a 4 e |
|
49 | 49 | pick 652413bf663e 5 f |
|
50 | 50 | |
|
51 | 51 | # Edit history between d2ae7f538514 and 652413bf663e |
|
52 | 52 | # |
|
53 | 53 | # Commands: |
|
54 | 54 | # p, pick = use commit |
|
55 | 55 | # e, edit = use commit, but stop for amending |
|
56 | 56 | # f, fold = use commit, but fold into previous commit (combines N and N-1) |
|
57 | 57 | # d, drop = remove commit from history |
|
58 | 58 | # m, mess = edit message without changing commit content |
|
59 | 59 | # |
|
60 | 60 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
61 |
$ cat > |
|
|
61 | $ cat > commands.txt <<EOF | |
|
62 | 62 | > pick 177f92b77385 2 c |
|
63 | 63 | > drop d2ae7f538514 1 b |
|
64 | 64 | > pick 055a42cdd887 3 d |
|
65 | 65 | > fold e860deea161a 4 e |
|
66 | 66 | > pick 652413bf663e 5 f |
|
67 | 67 | > EOF |
|
68 | 68 | $ hg histedit 1 --commands commands.txt --verbose | grep histedit |
|
69 | 69 | saved backup bundle to $TESTTMP/base/.hg/strip-backup/34a9919932c1-backup.hg (glob) |
|
70 | 70 | $ hg log --graph --hidden |
|
71 | 71 | @ 8:0efacef7cb48 f |
|
72 | 72 | | |
|
73 | 73 | o 7:ae467701c500 d |
|
74 | 74 | | |
|
75 | 75 | o 6:d36c0562f908 c |
|
76 | 76 | | |
|
77 | 77 | | x 5:652413bf663e f |
|
78 | 78 | | | |
|
79 | 79 | | x 4:e860deea161a e |
|
80 | 80 | | | |
|
81 | 81 | | x 3:055a42cdd887 d |
|
82 | 82 | | | |
|
83 | 83 | | x 2:177f92b77385 c |
|
84 | 84 | | | |
|
85 | 85 | | x 1:d2ae7f538514 b |
|
86 | 86 | |/ |
|
87 | 87 | o 0:cb9a9f314b8b a |
|
88 | 88 | |
|
89 | 89 | $ hg debugobsolete |
|
90 | 90 | e860deea161a2f77de56603b340ebbb4536308ae ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '*', 'user': 'test'} (glob) |
|
91 | 91 | 652413bf663ef2a641cab26574e46d5f5a64a55a 0efacef7cb481bf574f69075b82d044fdbe5c20f 0 {'date': '*': 'test'} (glob) |
|
92 | 92 | d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '*', 'user': 'test'} (glob) |
|
93 | 93 | 055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '*': 'test'} (glob) |
|
94 | 94 | 177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '*', 'user': 'test'} (glob) |
|
95 | 95 | |
|
96 | 96 | Ensure hidden revision does not prevent histedit |
|
97 | 97 | ------------------------------------------------- |
|
98 | 98 | |
|
99 | 99 | create an hidden revision |
|
100 | 100 | |
|
101 | 101 | $ cat > commands.txt <<EOF |
|
102 | 102 | > pick d36c0562f908 6 c |
|
103 | 103 | > drop ae467701c500 7 d |
|
104 | 104 | > pick 0efacef7cb48 8 f |
|
105 | 105 | > EOF |
|
106 | 106 | $ hg histedit 6 --commands commands.txt |
|
107 | 107 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
108 | 108 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
109 | 109 | $ hg log --graph |
|
110 | 110 | @ 9:7c044e3e33a9 f |
|
111 | 111 | | |
|
112 | 112 | o 6:d36c0562f908 c |
|
113 | 113 | | |
|
114 | 114 | o 0:cb9a9f314b8b a |
|
115 | 115 | |
|
116 | 116 | check hidden revision are ignored (6 have hidden children 7 and 8) |
|
117 | 117 | |
|
118 | 118 | $ cat > commands.txt <<EOF |
|
119 | 119 | > pick d36c0562f908 6 c |
|
120 | 120 | > pick 7c044e3e33a9 8 f |
|
121 | 121 | > EOF |
|
122 | 122 | $ hg histedit 6 --commands commands.txt |
|
123 | 123 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
124 | 124 | |
|
125 | 125 | |
|
126 | 126 | Check that histedit respect phases |
|
127 | 127 | ========================================= |
|
128 | 128 | |
|
129 | 129 | (not directly related to the test file but doesn't deserve it's own test case) |
|
130 | 130 | |
|
131 | 131 | $ hg log -G |
|
132 | 132 | @ 9:7c044e3e33a9 f |
|
133 | 133 | | |
|
134 | 134 | o 6:d36c0562f908 c |
|
135 | 135 | | |
|
136 | 136 | o 0:cb9a9f314b8b a |
|
137 | 137 | |
|
138 | 138 | $ hg ph -pv '.^' |
|
139 | 139 | phase changed for 2 changesets |
|
140 | 140 | $ hg histedit -r '.~2' |
|
141 | 141 | abort: cannot edit immutable changeset: cb9a9f314b8b |
|
142 | 142 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now