[PATCH] bookmarks: resolve divergent bookmark when moving forward

Kevin Bullock kbullock+mercurial at ringworld.org
Thu Mar 28 10:33:00 CDT 2013


On 27 Mar 2013, at 10:38 PM, Sean Farley wrote:

> Stephen Lee writes:
> 
>> On Thu, Mar 28, 2013 at 9:41 AM, Sean Farley
>> <sean.michael.farley at gmail.com> wrote:
>>> # HG changeset patch
>>> # User Sean Farley <sean.michael.farley at gmail.com>
>>> # Date 1364421288 18000
>>> #      Wed Mar 27 16:54:48 2013 -0500
>>> # Node ID 3839baf52f2f24c289487111a95e9e835d1e1c4d
>>> # Parent  a7d0ddc7540b2691f8a5af8006588a80e582754a
>>> bookmarks: resolve divergent bookmark when moving forward
>>> 
>>> This patch handles both cases of moving a bookmark forward 1) when running 'hg
>>> up' on a bookmark that has descendents, and 2) when running 'hg book NAME' on a
>>> descendents of a the active bookmark.
>>> 
>> 
>> What do you mean by "handling" these cases? What happens before and
>> after this patch?
> 
> Sorry; I meant to flag this as RFC so I could get some
> feedback. Anyways, before this patch when there was a divergent
> bookmark on a target changeset that you're moving a bookmark to, then
> both bookmarks would be there. Example,
> 
> $ hg init test && cd test
> $ echo a>a
> $ hg ci -Am0
> $ echo b>>a
> $ hg ci -m1
> $ hg book -r 0 @
> $ hg book -r 1 @default
> $ hg up @
> $ hg up
> 
> You'll see that the divergent is still lying around when it should be
> taken care of automatically. Applying this patch will fix that up but I
> wanted to make sure other behavior wasn't affected.

Normally this shouldn't happen in a real-life situation, because no divergent bookmarks are ever _created_ unless they actually... diverge. As in, they're on different topological branches. (Note also that rebase should take care of divergent bookmarks itself.)

Do you have a real-life case where this has come up?

Also, the above example should be rolled into your patch as an added test.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list