[PATCH] obsolete: consider successors along with descendants when updating
pierre-yves.david at ens-lyon.org
Mon Feb 11 11:37:07 CST 2013
On 11 févr. 2013, at 04:04, Kevin Bullock wrote:
> On 10 Feb 2013, at 9:47 PM, Levi Bard wrote:
>> # HG changeset patch
>> # User Levi Bard <levi at unity3d.com>
>> # Date 1360532614 -3600
>> # Node ID 8d89080a98d69606ac264282e2ba3e33b056bcac
>> # Parent 013fcd112f13f31a35ea6a40d8cd1c6923cdaf20
>> obsolete: consider successors along with descendants when updating
>> Currently, if you pull --update a group of changesets that obsoletes
>> the current changeset, mercurial refuses to update because the pulled tip
>> is not a descendant. This change causes mercurial to consider successors
>> as well as descendants when determining whether to update.
>> diff -r 013fcd112f13 -r 8d89080a98d6 mercurial/merge.py
>> --- a/mercurial/merge.py Sat Feb 09 11:00:42 2013 +0100
>> +++ b/mercurial/merge.py Sun Feb 10 22:43:34 2013 +0100
>> @@ -7,6 +7,7 @@
>> from node import nullid, nullrev, hex, bin
>> from i18n import _
>> +from mercurial import obsolete
>> import error, util, filemerge, copies, subrepo
>> import errno, os, shutil
>> @@ -632,6 +633,9 @@
>> elif not overwrite:
>> if pa == p1 or pa == p2: # linear
>> pass # all good
>> + elif repo.obsstore and \
>> + node in obsolete.allsuccessors(repo.obsstore, [p1.node()]):
> Wrap condition in parens instead of continuing the line with \.
>> + pa = p1 # allow updating to successors of obsolete nodes
> Huh, that's really all it takes?
The job was done for bookmark 6 months ago. If update target have the very same semantics than bookmarks target it should be good.
I'll have a closer look at this patch soon™.
More information about the Mercurial-devel