atom feed8 messages in com.selenic.mercurial-devel[PATCH] bookmarks: active bookmark di...
FromSent OnAttachments
Kevin BullockOct 24, 2012 2:04 pm 
Augie FacklerOct 26, 2012 6:43 am 
Sean FarleyOct 26, 2012 4:39 pm 
Pierre-Yves DavidOct 26, 2012 5:10 pm 
Kevin BullockOct 26, 2012 10:23 pm 
Matt MackallOct 27, 2012 3:41 pm 
Matt MackallNov 1, 2012 11:50 am 
Pierre-Yves DavidNov 9, 2012 9:27 am 
Subject:[PATCH] bookmarks: active bookmark diverges if a pull would move it (issue3682)
From:Kevin Bullock (kbul@ringworld.org)
Date:Oct 24, 2012 2:04:12 pm
List:com.selenic.mercurial-devel

# HG changeset patch # User Kevin Bullock <kbul@ringworld.org> # Date 1351112598 18000 # Branch stable # Node ID 188c42046dfd1441455c63cdde13c0ef757d17a5 # Parent acd4577a568d22d3e58bab28600a5ce0a3f87ce1 bookmarks: active bookmark diverges if a pull would move it (issue3682)

Before this change, a pull could move the active bookmark (even backwards). This resulted in the bookmark no longer being active (but still being listed in .hg/bookmarks.current -- also see issue3683).

After this change, if a pull would move the active bookmark, the divergent bookmarks machinery is invoked, leaving the active bookmark where it was.

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -196,7 +196,7 @@ def updatefromremote(ui, repo, remote, p cl = repo[nl] if cl.rev() >= cr.rev(): continue - if validdest(repo, cl, cr): + if validdest(repo, cl, cr) and k != repo._bookmarkcurrent: repo._bookmarks[k] = cr.node() changed = True ui.status(_("updating bookmark %s\n") % k) diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t --- a/tests/test-bookmarks-pushpull.t +++ b/tests/test-bookmarks-pushpull.t @@ -29,9 +29,9 @@ import bookmark by name

$ hg init ../b $ cd ../b - $ hg book Y + $ hg book --inactive Y $ hg book - * Y -1:000000000000 + Y -1:000000000000 $ hg pull ../a pulling from ../a requesting all changes