Why Does Update with No Args Move Bookmark?
Jensen, Aaron
ajensen at webmd.net
Tue Oct 15 18:33:55 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.
More information about the Mercurial
mailing list