Mercurial > public > mercurial-scm > hg-stable
diff mercurial/destutil.py @ 28065:6b1fc09c699a
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.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 02 Feb 2016 15:24:11 +0000 |
parents | 72072cfc7e91 |
children | bd74b5e0d2c0 |
line wrap: on
line diff
--- a/mercurial/destutil.py Wed Feb 03 15:21:11 2016 +0000 +++ b/mercurial/destutil.py Tue Feb 02 15:24:11 2016 +0000 @@ -92,7 +92,8 @@ wc = repo[None] movemark = node = None try: - node = repo.branchtip(wc.branch()) + node = repo.revs('max(.::(head() and branch(%s)))' + , wc.branch()).first() if bookmarks.isactivewdirparent(repo): movemark = repo['.'].node() except error.RepoLookupError: