Bookmarks with hg update question

Ethan Furman ethan at stoneleaf.us
Tue Jun 28 01:27:50 UTC 2016


On 06/27/2016 06:00 PM, Scott Palmer wrote:

> It's not that it can't be done, but existing scripts will break
 > (silently perhaps) and that sort of thing.

Valid point.  So the behavior change should happen with a major version 
change, then.

> If I have an *active* bookmark and I execute an update without specifying
 > a revision it means I want to advance the bookmark as far as I can.  If
 > you don't want the bookmark to move, don't activate it, or specify a
 > revision with your update.
>
> This is consistent with the non-bookmark workflow. You do an update with
 > no revision to move as far ahead as you can before committing new work.
 > Same goes if I want to commit the work to the active bookmark.

That is not consistent nor the same thing at all.  If I'm at revision 71 
and I issue `hg update` the tip does not suddenly become revision 71. 
If I'm at branch 3.4 and issue `hg update` I'm not suddenly at the tip 
of 3.5, with the tip of branch 3.4 also being there.  So why then if I'm 
at the bookmark 'gui_refresh' and I issue `hg update` and move forward 
31 commits, should the 'gui_refresh' bookmark also be there? 
Particularly when there are explicit ways to move it there -- like 
reissuing the bookmark command.

I suspect this is the heart of the problem:  `hg update` is doing double 
duty, and it shouldn't be -- at least not implicitly.  Particularly not 
when the general advice (and the specific advice from the program) is to 
use bookmarks instead of branches, yet the behavior of `hg update` is so 
vastly different between the two.

> I can just as well ask, "Would it be a major hardship to add 'tip' instead
 > of breaking existing workflows?"

It would not -- but that doesn't solve the problem as eventually I would 
forget to add 'tip' and then my bookmark would move and I would have to 
try and figure out where it came from, or, more likely, undo the damage 
from the commits that happened when I went back to my bookmark without 
realizing it wasn't where I thought it was.

> My current issue is that TortoiseHg doesn't have an easy way to do the
 > equivalent of the current command line behaviour. It  moves me off the
 > bookmark when I don't want it to. Explicitly moving the bookmark with
 > TortoiseHg is dangerous because I can easily accidentally jump to a
 > different head.

You wouldn't lose the ability to move your bookmark from the command 
line -- it would just cost you a few more characters.

--
~Ethan~



More information about the Mercurial mailing list