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