Mercurial > hg-stable
comparison tests/test-bookmarks-current.t @ 39303:337443f09fc8
bookmark: add an --active flag to display the active bookmark
There is currently no official simple way to retrieve the current bookmark. In
particular for automation.
We add a `--active` flag to the `hg bookmarks` command. When set, the command
display the current bookmark name if any or return 1.
For now, this flag is read-only. However sensible combinations exist with
`--delete`, `--rename` and `--rev` and can be implemented later.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 16 Aug 2018 17:19:27 +0200 |
parents | 2e1bceeea520 |
children | c48738923dba |
comparison
equal
deleted
inserted
replaced
39302:b17d27ea61fb | 39303:337443f09fc8 |
---|---|
220 X 3:4d6bd4bfb1ae | 220 X 3:4d6bd4bfb1ae |
221 * Y 4:8fa964221e8e | 221 * Y 4:8fa964221e8e |
222 Z 0:719295282060 | 222 Z 0:719295282060 |
223 $ hg parents -q | 223 $ hg parents -q |
224 4:8fa964221e8e | 224 4:8fa964221e8e |
225 | |
226 Checks command to retrieve active bookmark | |
227 ------------------------------------------ | |
228 | |
229 display how "{activebookmark}" template is unsuitable for the task | |
230 | |
231 $ hg book -T '- {activebookmark}\n' | |
232 - | |
233 - Y | |
234 - | |
235 | |
236 $ hg book -r . W | |
237 $ hg book -T '- {activebookmark}\n' | |
238 - Y | |
239 - | |
240 - Y | |
241 - | |
242 | |
243 $ hg bookmarks --active | |
244 Y | |
245 $ hg bookmarks --inactive | |
246 $ hg bookmarks --active | |
247 [1] |