[PATCH 1 of 2 STABLE] bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Kevin Bullock
kbullock+mercurial at ringworld.org
Mon Apr 29 19:49:15 CDT 2013
On 29 Apr 2013, at 5:38 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley at gmail.com>
> # Date 1367274592 18000
> # Mon Apr 29 17:29:52 2013 -0500
> # Branch stable
> # Node ID d6ff913a84d296fc6d1ed129351eb215d7e6920e
> # Parent f01a351db79106ba96ac6d527cf69944fd98e665
> bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
>
> This patch is a follow-up to 56dd55da2f7d that resolves divergent bookmarks
> between the to-be-forwarded bookmark MARK and the new descendant. This
> situation can happen when pulling new changesets, updating to the divergent
> bookmark, abandoning the previous changesets with strip, and then moving MARK
> to MARK at N.
>
> Test coverage is added.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -814,10 +814,14 @@
> if marks[mark] == target and target == cur:
> # re-activating a bookmark
> return
> anc = repo.changelog.ancestors([repo[target].rev()])
> bmctx = repo[marks[mark]]
> + divs = [repo[b].node() for b in marks
> + if b.split('@', 1)[0] == mark.split('@', 1)[0]]
> + deletefrom = [b for b in divs if repo[b].rev() in anc or b == target]
check-code says hi.
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
More information about the Mercurial-devel
mailing list