Bookmarks with hg update question

Ethan Furman ethan at stoneleaf.us
Tue Jun 28 15:20:00 UTC 2016


On 06/27/2016 08:52 PM, Scott Palmer wrote:
>> On Jun 27, 2016, at 9:27 PM, Ethan Furman wrote:

>> I suspect this is the heart of the problem:  `hg update` is doing double
 > duty, and it shouldn't be -- at least not implicitly.
>
> I don’t see it that way.  Bookmarks mark my current spot and they follow
 > along automatically, that’s the point of them.  hg update *with no args*
 > moves my current spot ahead in a natural way and only the active bookmark
 > (naturally) moves with it… it is supposed to ‘follow along’ to keep track
 > of my current spot.

To me, the only automatic "following along" should be on commit, not a 
plain update.

> Here is a test case where the bookmark does not jump to some unrelated branch when I execute ‘hg update’

[snipped, along with other very excellent examples]

Thank you for the examples, they did help clarify the current behavior. 
  I think it's safe to say you are a much more advanced mercurial user 
than myself.  :)

[snip proposal]

> Would that be a reasonable compromise, or am I just making things worse :-) ?

It wouldn't help me, unfortunately.  I suspect I am too grounded in how 
I use real-life bookmarks -- I put one in, I don't move it until I no 
longer need it at that place, and then I grab it and move it manually. 
If I was writing a journal I could see moving it habitually to my latest 
entry (commit), but if I had several entries going at once, and happened 
to place a bookmark at a common ancestor, and then flipped several pages 
to the entry I was currently working on -- well, *I* would be quite 
consternated to discover that my bookmark was not where I had left it at 
the common ancestor.

In the end I can agree that the current behavior is more logical and 
sound than I had originally thought, but I do not agree that it is the 
"best" behavior as issuing an `hg up` sometimes does, and sometimes does 
not, move the current bookmark.  Which means more rules to remember and 
more opportunities to get it wrong.

If changing the default behavior outright is not going to happen, I 
could live with an .hgrc setting that allowed me to change to the 
behavior I need, but I don't think that's the best solution.

--
~Ethan~



More information about the Mercurial mailing list