Why Does Update with No Args Move Bookmark?
Becker, Mischa J
mischa.becker at fredmeyer.com
Tue Oct 15 20:02:48 UTC 2013
>> > Why does `hg update` without arguments move a bookmark [1]? It
>> > seems like this could cause unintentional problems if someone does
>> > work on a bookmark, and un-mindfully runs `hg up`. This feels like a bug.
>
>> The short answer is that it simplifies the common scenario where you
>> pull changes from some public server, and you have not made any
>> commits of your own. "hg up" moves you to the tip of the current
>> branch and drags the bookmark with it so you are ready to start working.
>
> I agree that pulling from a public server is a common scenario, but disagree that the bookmark should move. I think the
> only operation that should cause a bookmark to move is a commit, or a specific command to do so.
>
> Whenever I create a branch, Mercurial warns me: "branches are permanent and global, did you want a bookmark?" If
> bookmarks are supposed to be lightweight branches, moving a bookmark on an update breaks that model. If I run
> `hg up` without any arguments, if I'm on a line that has a bookmark, it should update to or keep me on the bookmark, not
> to some other line. Moving the bookmark breaks the branch-iness of the bookmark. This behavior makes it really unlikely
> (as others have attested) that I'll ever use this feature. And I really, really want to use this feature.
My impression is that bookmarks were implemented to generally act how Git branches do. With my luck, that's probably completely wrong. :p But as someone who has never used Git and doesn't share repos with a large number of other people, bookmarks never seem to act the way I want\expect them to and I've mostly stopped using them.
i.e. When I'm bookmarking a revision, I'm bookmarking that specific change set, not that branch, not that tip, etc. If I add a new commit, I want the bookmark to stay where it was. If I do some history editing and strip a bookmarked change set, I want the bookmark to be deleted also, not moved to the first undeleted ancestor.
Now that I look at it in more detail, my first example might actually be a thg bug because I've told it to never activate bookmarks but it always does.
Mischa
________________________________
This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
More information about the Mercurial
mailing list