[PATCH 0 of 2] Use branch rev when setting bookmark with same name

Will Maier willmaier at ml1.net
Tue Nov 9 17:29:52 CST 2010


Hi Matt-

On Tue, Nov 09, 2010 at 11:04:08AM -0600, Matt Mackall wrote:
> > With this series, the bookmarks extension prefers local branches to
> > bookmarks when they share the same name. This behavior makes it easier to
> > keep a bookmark in sync with a local branch, which is a common task when
> > working with hg-git.
>
> What is a local branch?

I think I just meant 'branch' there. ;)

> You're proposing changing lookup so branch names take precedence over
> bookmarks.. always?

No; normal lookup should stay the same. When moving a bookmark that has
the same name as a branch, though, it makes more sense to use the branch's rev
instead of the bookmark's rev. Doing the former makes it possible to sync
bookmarks and branches; doing the latter is a noop.

For example, I have several Mercurial repos that are cloned to github via
hg-git. Some of those repos have stable branches, so I need to keep a 'stable'
bookmark in sync with the stable branch head. Without this series, the following
is always a noop:
    
    $ hg bookmarks -fr stable stable

With this series, hg would instead move the stable bookmark to the stable branch
head.

-- 

Will Maier
http://will.m.aier.us/


More information about the Mercurial mailing list