Mercurial > hg-stable
changeset 46198:72007a9ac064
clone: update to active bookmark, if set
This cannot happen during a normal Mercurial clone, but is useful for extensions like hg-git where we know what to check out — the Git HEAD — but do not wish to track it later on using the `@` bookmark.
Test Plan:
I have not included an explicit test, as this is much more easily tested within the `hg-git` test suite.
Differential Revision: https://phab.mercurial-scm.org/D9638
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Sun, 20 Dec 2020 15:38:50 +0100 |
parents | 2607a9346398 |
children | 8e7ce6555ea7 |
files | mercurial/hg.py |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hg.py Thu Dec 17 13:29:50 2020 +0100 +++ b/mercurial/hg.py Sun Dec 20 15:38:50 2020 +0100 @@ -1013,15 +1013,19 @@ pass if uprev is None: try: - uprev = destrepo._bookmarks[b'@'] - update = b'@' + if destrepo._activebookmark: + uprev = destrepo.lookup(destrepo._activebookmark) + update = destrepo._activebookmark + else: + uprev = destrepo._bookmarks[b'@'] + update = b'@' bn = destrepo[uprev].branch() if bn == b'default': - status = _(b"updating to bookmark @\n") + status = _(b"updating to bookmark %s\n" % update) else: status = ( - _(b"updating to bookmark @ on branch %s\n") % bn - ) + _(b"updating to bookmark %s on branch %s\n") + ) % (update, bn) except KeyError: try: uprev = destrepo.branchtip(b'default')