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 | echo "bookmarks=" >> $HGRCPATH | |
|
4 | $ hg init | |
|
5 | ||
|
6 | no bookmarks | |
|
5 | 7 | |
|
6 | hg init | |
|
8 | $ hg bookmarks | |
|
9 | no bookmarks set | |
|
7 | 10 | |
|
8 | echo % no bookmarks | |
|
9 | hg bookmarks | |
|
11 | bookmark rev -1 | |
|
12 | ||
|
13 | $ hg bookmark X | |
|
14 | ||
|
15 | list bookmarks | |
|
10 | 16 | |
|
11 | echo % bookmark rev -1 | |
|
12 | hg bookmark X | |
|
17 | $ hg bookmarks | |
|
18 | * X -1:000000000000 | |
|
13 | 19 | |
|
14 |
|
|
|
15 | hg bookmarks | |
|
20 | list bookmarks with color | |
|
21 | ||
|
22 | $ hg --config extensions.color= --config color.mode=ansi \ | |
|
23 | > bookmarks --color=always | |
|
24 | [0;32m * X -1:000000000000[0m | |
|
16 | 25 | |
|
17 | echo % list bookmarks with color | |
|
18 | hg --config extensions.color= --config color.mode=ansi \ | |
|
19 | bookmarks --color=always | |
|
26 | $ echo a > a | |
|
27 | $ hg add a | |
|
28 | $ hg commit -m 0 | |
|
20 | 29 | |
|
21 | echo a > a | |
|
22 | hg add a | |
|
23 | hg commit -m 0 | |
|
30 | bookmark X moved to rev 0 | |
|
31 | ||
|
32 | $ hg bookmarks | |
|
33 | * X 0:f7b1eb17ad24 | |
|
34 | ||
|
35 | look up bookmark | |
|
24 | 36 | |
|
25 | echo % bookmark X moved to rev 0 | |
|
26 | hg bookmarks | |
|
37 | $ hg log -r X | |
|
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 | |
|
29 | hg log -r X | |
|
46 | second bookmark for rev 0 | |
|
30 | 47 | |
|
31 | echo % second bookmark for rev 0 | |
|
32 | hg bookmark X2 | |
|
48 | $ hg bookmark X2 | |
|
49 | ||
|
50 | bookmark rev -1 again | |
|
51 | ||
|
52 | $ hg bookmark -r null Y | |
|
33 | 53 | |
|
34 | echo % bookmark rev -1 again | |
|
35 | hg bookmark -r null Y | |
|
54 | list bookmarks | |
|
55 | ||
|
56 | $ hg bookmarks | |
|
57 | * X2 0:f7b1eb17ad24 | |
|
58 | * X 0:f7b1eb17ad24 | |
|
59 | Y -1:000000000000 | |
|
36 | 60 | |
|
37 | echo % list bookmarks | |
|
38 | hg bookmarks | |
|
61 | $ echo b > b | |
|
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 | |
|
41 | hg add b | |
|
42 | hg commit -m 1 | |
|
67 | $ hg bookmarks | |
|
68 | * X2 1:925d80f479bb | |
|
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 | |
|
45 | hg bookmarks | |
|
74 | $ hg bookmark -r 0 Z | |
|
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 | |
|
48 | hg bookmark -r 0 Z | |
|
82 | $ hg bookmarks | |
|
83 | * X2 2:0316ce92851d | |
|
84 | * X 2:0316ce92851d | |
|
85 | Z 0:f7b1eb17ad24 | |
|
86 | Y -1:000000000000 | |
|
49 | 87 | |
|
50 | echo c > c | |
|
51 | hg add c | |
|
52 | hg commit -m 2 | |
|
88 | rename nonexistent bookmark | |
|
53 | 89 | |
|
54 | echo % bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0 | |
|
55 | hg bookmarks | |
|
90 | $ hg bookmark -m A B | |
|
91 | abort: a bookmark of this name does not exist | |
|
92 | ||
|
93 | rename to existent bookmark | |
|
56 | 94 | |
|
57 | echo % rename nonexistent bookmark | |
|
58 | hg bookmark -m A B | |
|
95 | $ hg bookmark -m X Y | |
|
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 | |
|
61 | hg bookmark -m X Y | |
|
100 | $ hg bookmark -f -m X Y | |
|
101 | ||
|
102 | list bookmarks | |
|
62 | 103 | |
|
63 | echo % force rename to existent bookmark | |
|
64 | hg bookmark -f -m X Y | |
|
104 | $ hg bookmark | |
|
105 | * X2 2:0316ce92851d | |
|
106 | * Y 2:0316ce92851d | |
|
107 | Z 0:f7b1eb17ad24 | |
|
108 | ||
|
109 | rename without new name | |
|
65 | 110 | |
|
66 | echo % list bookmarks | |
|
67 | hg bookmark | |
|
111 | $ hg bookmark -m Y | |
|
112 | abort: new bookmark name required | |
|
113 | ||
|
114 | delete without name | |
|
68 | 115 | |
|
69 | echo % rename without new name | |
|
70 | hg bookmark -m Y | |
|
116 | $ hg bookmark -d | |
|
117 | abort: bookmark name required | |
|
118 | ||
|
119 | delete nonexistent bookmark | |
|
71 | 120 | |
|
72 | echo % delete without name | |
|
73 | hg bookmark -d | |
|
121 | $ hg bookmark -d A | |
|
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 | |
|
76 | hg bookmark -d A | |
|
128 | list bookmarks | |
|
77 | 129 | |
|
78 | echo % bookmark name with spaces should be stripped | |
|
79 | hg bookmark ' x y ' | |
|
130 | $ hg bookmarks | |
|
131 | * X2 2:0316ce92851d | |
|
132 | * Y 2:0316ce92851d | |
|
133 | Z 0:f7b1eb17ad24 | |
|
134 | * x y 2:0316ce92851d | |
|
80 | 135 | |
|
81 | echo % list bookmarks | |
|
82 | hg bookmarks | |
|
83 | ||
|
84 | echo % look up stripped bookmark name | |
|
85 | hg log -r '"x y"' | |
|
136 | look up stripped bookmark name | |
|
86 | 137 | |
|
87 | echo % reject bookmark name with newline | |
|
88 | hg bookmark ' | |
|
89 | ' | |
|
138 | $ hg log -r '"x y"' | |
|
139 | changeset: 2:0316ce92851d | |
|
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 |
|
|
|
92 | hg bookmark Z | |
|
149 | reject bookmark name with newline | |
|
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 |
|
|
|
95 | hg bookmark -f Z | |
|
160 | force bookmark with existing name | |
|
161 | ||
|
162 | $ hg bookmark -f Z | |
|
163 | ||
|
164 | list bookmarks | |
|
96 | 165 | |
|
97 | echo % list bookmarks | |
|
98 | hg bookmark | |
|
166 | $ hg bookmark | |
|
167 | * X2 2:0316ce92851d | |
|
168 | * Y 2:0316ce92851d | |
|
169 | * Z 2:0316ce92851d | |
|
170 | * x y 2:0316ce92851d | |
|
99 | 171 | |
|
100 |
|
|
|
101 | hg bookmark -r . | |
|
172 | revision but no bookmark name | |
|
173 | ||
|
174 | $ hg bookmark -r . | |
|
175 | abort: bookmark name required | |
|
102 | 176 | |
|
103 |
|
|
|
104 | hg bookmark ' ' | |
|
177 | bookmark name with whitespace only | |
|
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 |
General Comments 0
You need to be logged in to leave comments.
Login now