Bookmarks with hg update question

Sietse Brouwer sbbrouwer at gmail.com
Thu Jun 30 22:43:59 UTC 2016


On 29 June 2016 at 03:18, Scott Palmer <swpalmer at gmail.com> wrote:
> As long as “hg update -B .” or whatever it is keeps the behaviour that it won't jump to a different topological branch, I will adapt.
[...]
> “hg update” is harmless because it won’t jump branches.

Would I be correct that you're worried that if `hg up` no longer moves
the current bookmark forward, and one must use `hg bookmark` (or `hg
up -B`) to move a bookmark, then it will become possible to
accidentally move a bookmark backwards or across to another branch
when using `hg bookmark`?

I don't think that's a concern: all `hg bookmark` commands that would
move a bookmark backwards or across to another topological branch
require a `-f` flag. Omitting the -f flag gives "abort: bookmark 'x'
already exists (use -f to force)"

I'm not sure how that translates to TortoiseHg -- does it pop up
warning, or ask for confirmation? Or does it silently do the dangerous
thing?

Anyway, here's the command-line behaviour.

Desired action         Command
---------------------  ----------------------------
Move bookmark forward  hg bookmark <bm>
to current commit
(and activate it)

Move bookmark non-fwd  hg bookmark <bm> -f
to current commit
(and activate it)

Move bookmark forward  hg bookmark <bm> -r <rev>
to anywhere

Move bookmark non-fwd  hg bookmark <bm> -r <rev> -f
to anywhere
---------------------  ----------------------------

Cheers,

Sietse
Sietse Brouwer


More information about the Mercurial mailing list