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