##// END OF EJS Templates
tests: unify test-bookmarks
Martin Geisler -
r11861:41d481dd default
parent child Browse files
Show More
@@ -1,106 +1,182 b''
1 #!/bin/sh
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "bookmarks=" >> $HGRCPATH
2
3
3 echo "[extensions]" >> $HGRCPATH
4 $ hg init
4 echo "bookmarks=" >> $HGRCPATH
5
6 no bookmarks
5
7
6 hg init
8 $ hg bookmarks
9 no bookmarks set
7
10
8 echo % no bookmarks
11 bookmark rev -1
9 hg bookmarks
12
13 $ hg bookmark X
14
15 list bookmarks
10
16
11 echo % bookmark rev -1
17 $ hg bookmarks
12 hg bookmark X
18 * X -1:000000000000
13
19
14 echo % list bookmarks
20 list bookmarks with color
15 hg bookmarks
21
22 $ hg --config extensions.color= --config color.mode=ansi \
23 > bookmarks --color=always
24  * X -1:000000000000
16
25
17 echo % list bookmarks with color
26 $ echo a > a
18 hg --config extensions.color= --config color.mode=ansi \
27 $ hg add a
19 bookmarks --color=always
28 $ hg commit -m 0
20
29
21 echo a > a
30 bookmark X moved to rev 0
22 hg add a
31
23 hg commit -m 0
32 $ hg bookmarks
33 * X 0:f7b1eb17ad24
34
35 look up bookmark
24
36
25 echo % bookmark X moved to rev 0
37 $ hg log -r X
26 hg bookmarks
38 changeset: 0:f7b1eb17ad24
39 tag: X
40 tag: tip
41 user: test
42 date: Thu Jan 01 00:00:00 1970 +0000
43 summary: 0
44
27
45
28 echo % look up bookmark
46 second bookmark for rev 0
29 hg log -r X
30
47
31 echo % second bookmark for rev 0
48 $ hg bookmark X2
32 hg bookmark X2
49
50 bookmark rev -1 again
51
52 $ hg bookmark -r null Y
33
53
34 echo % bookmark rev -1 again
54 list bookmarks
35 hg bookmark -r null Y
55
56 $ hg bookmarks
57 * X2 0:f7b1eb17ad24
58 * X 0:f7b1eb17ad24
59 Y -1:000000000000
36
60
37 echo % list bookmarks
61 $ echo b > b
38 hg bookmarks
62 $ hg add b
63 $ hg commit -m 1
64
65 bookmarks X and X2 moved to rev 1, Y at rev -1
39
66
40 echo b > b
67 $ hg bookmarks
41 hg add b
68 * X2 1:925d80f479bb
42 hg commit -m 1
69 * X 1:925d80f479bb
70 Y -1:000000000000
71
72 bookmark rev 0 again
43
73
44 echo % bookmarks X and X2 moved to rev 1, Y at rev -1
74 $ hg bookmark -r 0 Z
45 hg bookmarks
75
76 $ echo c > c
77 $ hg add c
78 $ hg commit -m 2
79
80 bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
46
81
47 echo % bookmark rev 0 again
82 $ hg bookmarks
48 hg bookmark -r 0 Z
83 * X2 2:0316ce92851d
84 * X 2:0316ce92851d
85 Z 0:f7b1eb17ad24
86 Y -1:000000000000
49
87
50 echo c > c
88 rename nonexistent bookmark
51 hg add c
52 hg commit -m 2
53
89
54 echo % bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
90 $ hg bookmark -m A B
55 hg bookmarks
91 abort: a bookmark of this name does not exist
92
93 rename to existent bookmark
56
94
57 echo % rename nonexistent bookmark
95 $ hg bookmark -m X Y
58 hg bookmark -m A B
96 abort: a bookmark of the same name already exists
97
98 force rename to existent bookmark
59
99
60 echo % rename to existent bookmark
100 $ hg bookmark -f -m X Y
61 hg bookmark -m X Y
101
102 list bookmarks
62
103
63 echo % force rename to existent bookmark
104 $ hg bookmark
64 hg bookmark -f -m X Y
105 * X2 2:0316ce92851d
106 * Y 2:0316ce92851d
107 Z 0:f7b1eb17ad24
108
109 rename without new name
65
110
66 echo % list bookmarks
111 $ hg bookmark -m Y
67 hg bookmark
112 abort: new bookmark name required
113
114 delete without name
68
115
69 echo % rename without new name
116 $ hg bookmark -d
70 hg bookmark -m Y
117 abort: bookmark name required
118
119 delete nonexistent bookmark
71
120
72 echo % delete without name
121 $ hg bookmark -d A
73 hg bookmark -d
122 abort: a bookmark of this name does not exist
123
124 bookmark name with spaces should be stripped
125
126 $ hg bookmark ' x y '
74
127
75 echo % delete nonexistent bookmark
128 list bookmarks
76 hg bookmark -d A
77
129
78 echo % bookmark name with spaces should be stripped
130 $ hg bookmarks
79 hg bookmark ' x y '
131 * X2 2:0316ce92851d
132 * Y 2:0316ce92851d
133 Z 0:f7b1eb17ad24
134 * x y 2:0316ce92851d
80
135
81 echo % list bookmarks
136 look up stripped bookmark name
82 hg bookmarks
83
84 echo % look up stripped bookmark name
85 hg log -r '"x y"'
86
137
87 echo % reject bookmark name with newline
138 $ hg log -r '"x y"'
88 hg bookmark '
139 changeset: 2:0316ce92851d
89 '
140 tag: X2
141 tag: Y
142 tag: tip
143 tag: x y
144 user: test
145 date: Thu Jan 01 00:00:00 1970 +0000
146 summary: 2
147
90
148
91 echo % bookmark with existing name
149 reject bookmark name with newline
92 hg bookmark Z
150
151 $ hg bookmark '
152 > '
153 abort: bookmark name cannot contain newlines
154
155 bookmark with existing name
156
157 $ hg bookmark Z
158 abort: a bookmark of the same name already exists
93
159
94 echo % force bookmark with existing name
160 force bookmark with existing name
95 hg bookmark -f Z
161
162 $ hg bookmark -f Z
163
164 list bookmarks
96
165
97 echo % list bookmarks
166 $ hg bookmark
98 hg bookmark
167 * X2 2:0316ce92851d
168 * Y 2:0316ce92851d
169 * Z 2:0316ce92851d
170 * x y 2:0316ce92851d
99
171
100 echo % revision but no bookmark name
172 revision but no bookmark name
101 hg bookmark -r .
173
174 $ hg bookmark -r .
175 abort: bookmark name required
102
176
103 echo % bookmark name with whitespace only
177 bookmark name with whitespace only
104 hg bookmark ' '
105
178
106 true
179 $ hg bookmark ' '
180 abort: bookmark names cannot consist entirely of whitespace
181
182 $ true
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now