annotate tests/test-bookmarks.t @ 11989:f853873fc66d

aliases: provide more flexible ways to work with shell alias arguments This patch changes the functionality of shell aliases to add more powerful options for working with shell alias arguments. First: the alias name + arguments to a shell alias are set as an HG_ARGS environment variable, delimited by spaces. This matches the behavior of hooks. Second: any occurrences of "$@" (without quotes) are replaced with the arguments, separated by spaces. This happens *before* the alias gets to the shell. Third: any positive numeric variables ("$1", "$2", etc) are replaced with the appropriate argument, indexed from 1. "$0" is replaced with the name of the alias. Any "extra" numeric variables are replaced with an empty string. This happens *before* the alias gets to the shell. These changes allow for more flexible shell aliases: [alias] echo = !echo $@ count = !hg log -r "$@" --template='.' | wc -c | sed -e 's/ //g' qqueuemv = !mv "`hg root`/.hg/patches-$1" "`hg root`/.hg/patches-$2" In action: $ hg echo foo foo $ hg count 'branch(default)' 901 $ hg count 'branch(stable) and keyword(fixes)' 102 $ hg qqueuemv myfeature somefeature
author Steve Losh <steve@stevelosh.com>
date Wed, 18 Aug 2010 18:56:44 -0400
parents 41d481ddd976
children 4134686b83e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
1 $ echo "[extensions]" >> $HGRCPATH
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
2 $ echo "bookmarks=" >> $HGRCPATH
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
3
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
4 $ hg init
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
5
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
6 no bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
7
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
8 $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
9 no bookmarks set
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
10
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
11 bookmark rev -1
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
12
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
13 $ hg bookmark X
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
14
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
15 list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
16
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
17 $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
18 * X -1:000000000000
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
19
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
20 list bookmarks with color
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
21
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
22 $ hg --config extensions.color= --config color.mode=ansi \
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
23 > bookmarks --color=always
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
24  * X -1:000000000000
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
25
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
26 $ echo a > a
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
27 $ hg add a
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
28 $ hg commit -m 0
10826
717c35d55fb3 color: colorize based on output labels instead of parsing output
Brodie Rao <brodie@bitheap.org>
parents: 7261
diff changeset
29
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
30 bookmark X moved to rev 0
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
31
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
32 $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
33 * X 0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
34
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
35 look up bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
36
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
37 $ hg log -r X
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
38 changeset: 0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
39 tag: X
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
40 tag: tip
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
41 user: test
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
42 date: Thu Jan 01 00:00:00 1970 +0000
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
43 summary: 0
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
44
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
45
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
46 second bookmark for rev 0
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
47
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
48 $ hg bookmark X2
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
49
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
50 bookmark rev -1 again
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
51
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
52 $ hg bookmark -r null Y
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
53
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
54 list bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
55
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
56 $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
57 * X2 0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
58 * X 0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
59 Y -1:000000000000
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
60
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
61 $ echo b > b
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
62 $ hg add b
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
63 $ hg commit -m 1
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
64
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
65 bookmarks X and X2 moved to rev 1, Y at rev -1
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
66
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
67 $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
68 * X2 1:925d80f479bb
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
69 * X 1:925d80f479bb
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
70 Y -1:000000000000
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
71
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
72 bookmark rev 0 again
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
73
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
74 $ hg bookmark -r 0 Z
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
75
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
76 $ echo c > c
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
77 $ hg add c
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
78 $ hg commit -m 2
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
79
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
80 bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
81
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
82 $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
83 * X2 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
84 * X 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
85 Z 0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
86 Y -1:000000000000
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
87
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
88 rename nonexistent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
89
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
90 $ hg bookmark -m A B
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
91 abort: a bookmark of this name does not exist
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
92
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
93 rename to existent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
94
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
95 $ hg bookmark -m X Y
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
96 abort: a bookmark of the same name already exists
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
97
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
98 force rename to existent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
99
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
100 $ hg bookmark -f -m X Y
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
101
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
102 list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
103
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
104 $ hg bookmark
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
105 * X2 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
106 * Y 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
107 Z 0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
108
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
109 rename without new name
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
110
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
111 $ hg bookmark -m Y
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
112 abort: new bookmark name required
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
113
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
114 delete without name
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
115
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
116 $ hg bookmark -d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
117 abort: bookmark name required
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
118
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
119 delete nonexistent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
120
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
121 $ hg bookmark -d A
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
122 abort: a bookmark of this name does not exist
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
123
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
124 bookmark name with spaces should be stripped
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
125
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
126 $ hg bookmark ' x y '
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
127
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
128 list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
129
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
130 $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
131 * X2 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
132 * Y 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
133 Z 0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
134 * x y 2:0316ce92851d
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
135
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
136 look up stripped bookmark name
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
137
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
138 $ hg log -r '"x y"'
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
139 changeset: 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
140 tag: X2
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
141 tag: Y
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
142 tag: tip
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
143 tag: x y
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
144 user: test
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
145 date: Thu Jan 01 00:00:00 1970 +0000
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
146 summary: 2
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
147
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
148
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
149 reject bookmark name with newline
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
150
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
151 $ hg bookmark '
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
152 > '
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
153 abort: bookmark name cannot contain newlines
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
154
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
155 bookmark with existing name
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
156
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
157 $ hg bookmark Z
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
158 abort: a bookmark of the same name already exists
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
159
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
160 force bookmark with existing name
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
161
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
162 $ hg bookmark -f Z
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
163
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
164 list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
165
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
166 $ hg bookmark
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
167 * X2 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
168 * Y 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
169 * Z 2:0316ce92851d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
170 * x y 2:0316ce92851d
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
171
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
172 revision but no bookmark name
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
173
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
174 $ hg bookmark -r .
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
175 abort: bookmark name required
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
176
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
177 bookmark name with whitespace only
11704
18c47562d331 bookmarks: don't allow name to contain whitespaces only
Idan Kamara <idankk86@gmail.com>
parents: 11282
diff changeset
178
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
179 $ hg bookmark ' '
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
180 abort: bookmark names cannot consist entirely of whitespace
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
181
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
182 $ true