Why Does Update with No Args Move Bookmark?
Stephen Lee
sphen.lee at gmail.com
Thu Oct 10 02:55:10 UTC 2013
On Thu, Oct 10, 2013 at 12:00 PM, Jensen, Aaron <ajensen at webmd.net> wrote:
>
> 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.
If you had made your own commits then "hg up" complains that the
update will cross a branch and fails (suggesting you merge).
This is the fail-safe that prevents you from accidentally moving the
bookmark when you didn't want to.
>
> I ask because I’m trying to model a new release process in Mercurial. Our releases begin on Thursdays, and go live the following Wednesday. On Thursday, we build our software, create a bookmark for that release, and release it into our test environment. On Monday, we build from that bookmark, and release to our staging environment. On Wednesday, what’s on staging goes live. If there are any bug fixes, developers will pull down changes, update to the release bookmark, make the changes, then push them out. Changes that aren’t ready to go are happening back on the mainline. I’m worried that because update moves the bookmark, someone could inadvertently do an update and move our release bookmark to the wrong place.
>
A way to fix this would be to add another bookmark on the
"development" head. If all heads have bookmarks "hg up" also
complains and asks you to specify one - in this case that bookmark is
activated and the current one does not move.
Steve
More information about the Mercurial
mailing list