7261
|
1 |
#!/bin/sh
|
|
2 |
|
|
3 |
echo "[extensions]" >> $HGRCPATH
|
|
4 |
echo "bookmarks=" >> $HGRCPATH
|
|
5 |
|
|
6 |
hg init
|
|
7 |
|
|
8 |
echo % no bookmarks
|
|
9 |
hg bookmarks
|
|
10 |
|
|
11 |
echo % bookmark rev -1
|
|
12 |
hg bookmark X
|
|
13 |
|
|
14 |
echo % list bookmarks
|
|
15 |
hg bookmarks
|
|
16 |
|
|
17 |
echo a > a
|
|
18 |
hg add a
|
|
19 |
hg commit -m 0
|
|
20 |
|
|
21 |
echo % bookmark X moved to rev 0
|
|
22 |
hg bookmarks
|
|
23 |
|
|
24 |
echo % look up bookmark
|
|
25 |
hg log -r X
|
|
26 |
|
|
27 |
echo % second bookmark for rev 0
|
|
28 |
hg bookmark X2
|
|
29 |
|
|
30 |
echo % bookmark rev -1 again
|
|
31 |
hg bookmark -r null Y
|
|
32 |
|
|
33 |
echo % list bookmarks
|
|
34 |
hg bookmarks
|
|
35 |
|
|
36 |
echo b > b
|
|
37 |
hg add b
|
|
38 |
hg commit -m 1
|
|
39 |
|
|
40 |
echo % bookmarks X and X2 moved to rev 1, Y at rev -1
|
|
41 |
hg bookmarks
|
|
42 |
|
|
43 |
echo % bookmark rev 0 again
|
|
44 |
hg bookmark -r 0 Z
|
|
45 |
|
|
46 |
echo c > c
|
|
47 |
hg add c
|
|
48 |
hg commit -m 2
|
|
49 |
|
|
50 |
echo % bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
|
|
51 |
hg bookmarks
|
|
52 |
|
|
53 |
echo % rename nonexistent bookmark
|
|
54 |
hg bookmark -m A B
|
|
55 |
|
|
56 |
echo % rename to existent bookmark
|
|
57 |
hg bookmark -m X Y
|
|
58 |
|
|
59 |
echo % force rename to existent bookmark
|
|
60 |
hg bookmark -f -m X Y
|
|
61 |
|
|
62 |
echo % list bookmarks
|
|
63 |
hg bookmark
|
|
64 |
|
|
65 |
echo % rename without new name
|
|
66 |
hg bookmark -m Y
|
|
67 |
|
|
68 |
echo % delete without name
|
|
69 |
hg bookmark -d
|
|
70 |
|
|
71 |
echo % delete nonexistent bookmark
|
|
72 |
hg bookmark -d A
|
|
73 |
|
|
74 |
echo % bookmark name with spaces should be stripped
|
|
75 |
hg bookmark ' x y '
|
|
76 |
|
|
77 |
echo % list bookmarks
|
|
78 |
hg bookmarks
|
|
79 |
|
|
80 |
echo % look up stripped bookmark name
|
|
81 |
hg log -r 'x y'
|
|
82 |
|
|
83 |
echo % reject bookmark name with newline
|
|
84 |
hg bookmark '
|
|
85 |
'
|
|
86 |
|
|
87 |
echo % bookmark with existing name
|
|
88 |
hg bookmark Z
|
|
89 |
|
|
90 |
echo % force bookmark with existing name
|
|
91 |
hg bookmark -f Z
|
|
92 |
|
|
93 |
echo % list bookmarks
|
|
94 |
hg bookmark
|
|
95 |
|
|
96 |
echo % revision but no bookmark name
|
|
97 |
hg bookmark -r .
|
|
98 |
|
|
99 |
true
|