How to *not* export a bookmark?
Andi McClure
andi.m.mcclure at gmail.com
Wed Sep 24 19:01:54 UTC 2014
Here is a common mistake I make:
hg pull -r basebranch
hg up basebranch
[some trivial change]
hg commit -m "Trivial change"
hg book basebranch_modified
hg push --book basebranch_modified
My intent here is to go to a particular bookmark; make a change and check
it in; and then create and push a new bookmark for the new changeset, while
leaving the old bookmark alone. However, I made a mistake: I should have
said book *before* commit, or deactivated the bookmark before I committed.
Since I instead committed first, basebranch (which was activated when I
updated) will move up to my new commit, and when I push it will set both
basebranch and basebranch_modified on the server as being equal to my new
commit.
There is something weird about this to me: When I pushed, I instructed it
to push basebranch_modified, but did not instruct it to push basebranch.
But, it pushed basebranch anyway. I think this is because when hg pushes
a changeset it also pushes all bookmarks associated with that changeset,
regardless of how the changeset was specified.
I would like to be able to push a bookmark and *only that bookmark*, not
exporting anything I didn't request. Is there a way to do this? Should
there be?
On a related note: So that I could make these errors less likely in the
first place, is there some way to update to a bookmark without activating
it? Should there be? (*This* I think I could achieve myself using a
post-update hook or something that automatically book -i's after each
update, but it seems like a fundamentally useful thing.)
For context, the reason I am so concerned about bookmarks is I use the
hg-git extension, which maps local bookmarks to remote git branches. This
of course means any mistakes at all concerning bookmarks can have very
serious results at the other end.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20140924/15076db0/attachment-0002.html>
More information about the Mercurial
mailing list