[PATCH 2 of 2] update: change default destination to tipmost descendant (issue4673) (BC)

Martin von Zweigbergk martinvonz at google.com
Thu Feb 11 17:49:25 EST 2016


On Tue, Feb 9, 2016 at 11:16 AM, Pierre-Yves David
<pierre-yves.david at ens-lyon.org> 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
>
> All test changes have been reviewed and seen a valid consequences.
>
> 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()
> +        # node = repo.branchtip(wc.branch())

I dropped this commented-out line, made the change Yuya suggested, and
pushed to the clowncopter. Thanks!


More information about the Mercurial-devel mailing list