[PATCH 2 of 2] update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Thu Feb 11 14:47:34 UTC 2016
On 02/11/2016 02:01 PM, Yuya Nishihara wrote:
> On Tue, 09 Feb 2016 19:16:06 +0000, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at fb.com>
>> # Date 1454426651 0
>> # Tue Feb 02 15:24:11 2016 +0000
>> # Node ID 913b57e4a14d5961dbd845a45160b51a968c193a
>> # Parent f865f8c9b492bea4514ba49c7c1cf2fa918f9a96
>> # EXP-Topic destination
>> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
>> # hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 913b57e4a14d
>> update: change default destination to tipmost descendant (issue4673) (BC)
>>
>> Bare 'hg update' now brings you to the tipmost descendant (on the same branch).
>> Leaving the user on the same topological branch. The previous behavior, updating
>> to the tipmost changeset on the same branch could lead to jump from a
>> topological branch to another. This was confusing and impractical. As the only
>> conceivable reason for the old behavior have been address by the recently
>> introduce message about other heads, we can "safely" change this behavior
>
> New behavior makes sense to me.
>
>> diff --git a/mercurial/destutil.py b/mercurial/destutil.py
>> --- a/mercurial/destutil.py
>> +++ b/mercurial/destutil.py
>> @@ -90,11 +90,13 @@ def _destupdatebook(repo, clean, check):
>> def _destupdatebranch(repo, clean, check):
>> """decide on an update destination from current branch"""
>> wc = repo[None]
>> movemark = node = None
>> try:
>> - node = repo.branchtip(wc.branch())
>> + node = repo.revs('max(.::(head() and branch("%s")))'
>> + % wc.branch()).first()
>
> Typo of revs('.. branch(%s)', wc.branch()) ?
Good catch, do you want to fix in flight or do you want a V2?
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list