terminology confusion: bookmark vs named head
Matt Mackall
mpm at selenic.com
Thu Dec 19 00:09:42 UTC 2013
On Thu, 2013-12-19 at 10:44 +1100, Stephen Lee wrote:
> >> In a clone based workflow we do:
> >> hg pull; hg merge (if the clones have diverged)
> >> hg pull; hg up (if the clones have not diverged)
> >>
> >> In a bookmark workflow:
> >> hg pull; hg merge; (if diverged)
> >> hg pull; hg up; hg book; (if not diverged)
> >>
> >> That extra bookmark step is annoying and easy to forget.
> >
> > I don't do the extra "hg book" thing. Why are you doing it?
> >
>
> Because hg update deactivates the current bookmark.
>
> For example I create a feature branch foo:
> $ hg book foo
> I then pull from upstream because new changesets have come in before I
> have done any work:
> $ hg pull
> Now, to "merge" my feature branch with upstream I would use hg update
> because there has been no divergence:
> I need to specify @ because in a bookmark workflow, typically all
> heads are bookmarked and @ refers to the master/main branch.
> $ hg update @
> Now @ is the active bookmark and foo did not move, so I have to fix this:
Your learning for today: "hg up" != "hg up <any identifier>"
(The update command is basically two commands in one, a choice we made
about a decade ago by looking at the way CVS and SVN work. No point
complaining about it, as its now about a decade too late to change.)
The former tries to figure out if there's an unambiguous place to move
forward to and then goes to it, moving any current bookmark.
The latter JUMPS to the specified revision regardless of whether it's
forward or backward in history, on a different branch, or whatever. If
it's a bookmark, it activates it.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list