Show More
@@ -1,144 +1,155 b'' | |||||
1 | Test argument handling and various data parsing |
|
1 | Test argument handling and various data parsing | |
2 | ================================================== |
|
2 | ================================================== | |
3 |
|
3 | |||
4 |
|
4 | |||
5 | Enable extensions used by this test. |
|
5 | Enable extensions used by this test. | |
6 | $ cat >>$HGRCPATH <<EOF |
|
6 | $ cat >>$HGRCPATH <<EOF | |
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > histedit= |
|
8 | > histedit= | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | Repo setup. |
|
11 | Repo setup. | |
12 | $ hg init foo |
|
12 | $ hg init foo | |
13 | $ cd foo |
|
13 | $ cd foo | |
14 | $ echo alpha >> alpha |
|
14 | $ echo alpha >> alpha | |
15 | $ hg addr |
|
15 | $ hg addr | |
16 | adding alpha |
|
16 | adding alpha | |
17 | $ hg ci -m one |
|
17 | $ hg ci -m one | |
18 | $ echo alpha >> alpha |
|
18 | $ echo alpha >> alpha | |
19 | $ hg ci -m two |
|
19 | $ hg ci -m two | |
20 | $ echo alpha >> alpha |
|
20 | $ echo alpha >> alpha | |
21 | $ hg ci -m three |
|
21 | $ hg ci -m three | |
22 | $ echo alpha >> alpha |
|
22 | $ echo alpha >> alpha | |
23 | $ hg ci -m four |
|
23 | $ hg ci -m four | |
24 | $ echo alpha >> alpha |
|
24 | $ echo alpha >> alpha | |
25 | $ hg ci -m five |
|
25 | $ hg ci -m five | |
26 |
|
26 | |||
27 | $ hg log --style compact --graph |
|
27 | $ hg log --style compact --graph | |
28 | @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test |
|
28 | @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test | |
29 | | five |
|
29 | | five | |
30 | | |
|
30 | | | |
31 | o 3 c8e68270e35a 1970-01-01 00:00 +0000 test |
|
31 | o 3 c8e68270e35a 1970-01-01 00:00 +0000 test | |
32 | | four |
|
32 | | four | |
33 | | |
|
33 | | | |
34 | o 2 eb57da33312f 1970-01-01 00:00 +0000 test |
|
34 | o 2 eb57da33312f 1970-01-01 00:00 +0000 test | |
35 | | three |
|
35 | | three | |
36 | | |
|
36 | | | |
37 | o 1 579e40513370 1970-01-01 00:00 +0000 test |
|
37 | o 1 579e40513370 1970-01-01 00:00 +0000 test | |
38 | | two |
|
38 | | two | |
39 | | |
|
39 | | | |
40 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test |
|
40 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test | |
41 | one |
|
41 | one | |
42 |
|
42 | |||
43 |
|
43 | |||
44 | Run a dummy edit to make sure we get tip^^ correctly via revsingle. |
|
44 | Run a dummy edit to make sure we get tip^^ correctly via revsingle. | |
45 | -------------------------------------------------------------------- |
|
45 | -------------------------------------------------------------------- | |
46 |
|
46 | |||
47 | $ HGEDITOR=cat hg histedit "tip^^" |
|
47 | $ HGEDITOR=cat hg histedit "tip^^" | |
48 | pick eb57da33312f 2 three |
|
48 | pick eb57da33312f 2 three | |
49 | pick c8e68270e35a 3 four |
|
49 | pick c8e68270e35a 3 four | |
50 | pick 08d98a8350f3 4 five |
|
50 | pick 08d98a8350f3 4 five | |
51 |
|
51 | |||
52 | # Edit history between eb57da33312f and 08d98a8350f3 |
|
52 | # Edit history between eb57da33312f and 08d98a8350f3 | |
53 | # |
|
53 | # | |
54 | # Commands: |
|
54 | # Commands: | |
55 | # p, pick = use commit |
|
55 | # p, pick = use commit | |
56 | # e, edit = use commit, but stop for amending |
|
56 | # e, edit = use commit, but stop for amending | |
57 | # f, fold = use commit, but fold into previous commit (combines N and N-1) |
|
57 | # f, fold = use commit, but fold into previous commit (combines N and N-1) | |
58 | # d, drop = remove commit from history |
|
58 | # d, drop = remove commit from history | |
59 | # m, mess = edit message without changing commit content |
|
59 | # m, mess = edit message without changing commit content | |
60 | # |
|
60 | # | |
61 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
61 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
62 |
|
62 | |||
63 | Run on a revision not ancestors of the current working directory. |
|
63 | Run on a revision not ancestors of the current working directory. | |
64 | -------------------------------------------------------------------- |
|
64 | -------------------------------------------------------------------- | |
65 |
|
65 | |||
66 | $ hg up 2 |
|
66 | $ hg up 2 | |
67 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
68 | $ hg histedit -r 4 |
|
68 | $ hg histedit -r 4 | |
69 | abort: 08d98a8350f3 is not an ancestor of working directory |
|
69 | abort: 08d98a8350f3 is not an ancestor of working directory | |
70 | [255] |
|
70 | [255] | |
71 | $ hg up --quiet |
|
71 | $ hg up --quiet | |
72 |
|
72 | |||
73 | Test that missing revisions are detected |
|
73 | Test that missing revisions are detected | |
74 | --------------------------------------- |
|
74 | --------------------------------------- | |
75 |
|
75 | |||
76 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
76 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
77 | > pick eb57da33312f 2 three |
|
77 | > pick eb57da33312f 2 three | |
78 | > pick 08d98a8350f3 4 five |
|
78 | > pick 08d98a8350f3 4 five | |
79 | > EOF |
|
79 | > EOF | |
80 | abort: must specify a rule for each changeset once |
|
80 | abort: must specify a rule for each changeset once | |
81 | [255] |
|
81 | [255] | |
82 |
|
82 | |||
83 | Test that extra revisions are detected |
|
83 | Test that extra revisions are detected | |
84 | --------------------------------------- |
|
84 | --------------------------------------- | |
85 |
|
85 | |||
86 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
86 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
87 | > pick 6058cbb6cfd7 0 one |
|
87 | > pick 6058cbb6cfd7 0 one | |
88 | > pick c8e68270e35a 3 four |
|
88 | > pick c8e68270e35a 3 four | |
89 | > pick 08d98a8350f3 4 five |
|
89 | > pick 08d98a8350f3 4 five | |
90 | > EOF |
|
90 | > EOF | |
91 | abort: may not use changesets other than the ones listed |
|
91 | abort: may not use changesets other than the ones listed | |
92 | [255] |
|
92 | [255] | |
93 |
|
93 | |||
94 | Test malformed line |
|
94 | Test malformed line | |
95 | --------------------------------------- |
|
95 | --------------------------------------- | |
96 |
|
96 | |||
97 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
97 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
98 | > pickeb57da33312f2three |
|
98 | > pickeb57da33312f2three | |
99 | > pick c8e68270e35a 3 four |
|
99 | > pick c8e68270e35a 3 four | |
100 | > pick 08d98a8350f3 4 five |
|
100 | > pick 08d98a8350f3 4 five | |
101 | > EOF |
|
101 | > EOF | |
102 | abort: malformed line "pickeb57da33312f2three" |
|
102 | abort: malformed line "pickeb57da33312f2three" | |
103 | [255] |
|
103 | [255] | |
104 |
|
104 | |||
105 | Test unknown changeset |
|
105 | Test unknown changeset | |
106 | --------------------------------------- |
|
106 | --------------------------------------- | |
107 |
|
107 | |||
108 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
108 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
109 | > pick 0123456789ab 2 three |
|
109 | > pick 0123456789ab 2 three | |
110 | > pick c8e68270e35a 3 four |
|
110 | > pick c8e68270e35a 3 four | |
111 | > pick 08d98a8350f3 4 five |
|
111 | > pick 08d98a8350f3 4 five | |
112 | > EOF |
|
112 | > EOF | |
113 | abort: unknown changeset 0123456789ab listed |
|
113 | abort: unknown changeset 0123456789ab listed | |
114 | [255] |
|
114 | [255] | |
115 |
|
115 | |||
|
116 | Test unknown command | |||
|
117 | --------------------------------------- | |||
|
118 | ||||
|
119 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |||
|
120 | > coin eb57da33312f 2 three | |||
|
121 | > pick c8e68270e35a 3 four | |||
|
122 | > pick 08d98a8350f3 4 five | |||
|
123 | > EOF | |||
|
124 | abort: unknown action "coin" | |||
|
125 | [255] | |||
|
126 | ||||
116 | Test short version of command |
|
127 | Test short version of command | |
117 | --------------------------------------- |
|
128 | --------------------------------------- | |
118 |
|
129 | |||
119 | Note: we use varying amounts of white space between command name and changeset |
|
130 | Note: we use varying amounts of white space between command name and changeset | |
120 | short hash. This tests issue3893. |
|
131 | short hash. This tests issue3893. | |
121 |
|
132 | |||
122 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
133 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
123 | > pick eb57da33312f 2 three |
|
134 | > pick eb57da33312f 2 three | |
124 | > p c8e68270e35a 3 four |
|
135 | > p c8e68270e35a 3 four | |
125 | > f 08d98a8350f3 4 five |
|
136 | > f 08d98a8350f3 4 five | |
126 | > EOF |
|
137 | > EOF | |
127 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
138 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
128 | reverting alpha |
|
139 | reverting alpha | |
129 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
130 | four |
|
141 | four | |
131 | *** |
|
142 | *** | |
132 | five |
|
143 | five | |
133 |
|
144 | |||
134 |
|
145 | |||
135 |
|
146 | |||
136 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
147 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
137 | HG: Leave message empty to abort commit. |
|
148 | HG: Leave message empty to abort commit. | |
138 | HG: -- |
|
149 | HG: -- | |
139 | HG: user: test |
|
150 | HG: user: test | |
140 | HG: branch 'default' |
|
151 | HG: branch 'default' | |
141 | HG: changed alpha |
|
152 | HG: changed alpha | |
142 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
153 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
143 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
154 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
144 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob) |
|
155 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now