Why Does Update with No Args Move Bookmark?

Jensen, Aaron ajensen at webmd.net
Thu Oct 10 01:00:11 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.

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.

I suppose I could create a dedicated branch for the release, but I wanted the process to be automated, and merging from one branch isn't amenable to consistent automation.

[1] Steps to reproduce:
    $ hg init Bookmark
    $ cd Bookmark
    $ '' > first
    $ hg add first
    $ hg ci -m "first"
    $ hg bookmark fizzbuzz
    $ '' > second
    $ hg add second
    $ hg ci -m "second"
    $ hg up 0
    $ 'new' > first
    $ hg ci -m "updating first"
    $ hg up fizzbuzz    # moves to bookmark
    $ hg up             # moves back to default, but also *moves* bookmark to the tip of default


How Did I Do?

[Happy]<https://secure.teamhively.com/welcome/rate/2185/3>

[Satisfied]<https://secure.teamhively.com/welcome/rate/2185/2>

[Unhappy]<https://secure.teamhively.com/welcome/rate/2185/1>

Woot!<https://secure.teamhively.com/welcome/rate/2185/3>

Meh<https://secure.teamhively.com/welcome/rate/2185/2>

Boo!<https://secure.teamhively.com/welcome/rate/2185/1>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20131010/b2db495c/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 1308 bytes
Desc: image007.png
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20131010/b2db495c/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 1231 bytes
Desc: image008.png
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20131010/b2db495c/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.png
Type: image/png
Size: 1237 bytes
Desc: image009.png
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20131010/b2db495c/attachment-0008.png>


More information about the Mercurial mailing list