From b1442548490443de908c011a24a4e1938a41df94 Mon Sep 17 00:00:00 2001 From: Thomas Arendsen Hein Date: Tue, 2 Oct 2012 09:26:42 +0200 Subject: [PATCH] clone: activate bookmark specified with --updaterev --- mercurial/hg.py | 2 ++ tests/test-bookmarks.t | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/mercurial/hg.py b/mercurial/hg.py index f2e9e61c3b..9f7edd752a 100644 --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -410,6 +410,8 @@ def clone(ui, peeropts, source, dest=None, pull=False, rev=None, bn = destrepo[uprev].branch() destrepo.ui.status(_("updating to branch %s\n") % bn) _update(destrepo, uprev) + if update in destrepo._bookmarks: + bookmarks.setcurrent(destrepo, update) return srcpeer, destpeer finally: diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t index 8b8d062704..eb3a0302de 100644 --- a/tests/test-bookmarks.t +++ b/tests/test-bookmarks.t @@ -336,6 +336,17 @@ test clone with a specific revision $ hg -R cloned-bookmarks-rev bookmarks X2 1:925d80f479bb +test clone with update to a bookmark + + $ hg clone -u Z . cloned-bookmarks-update + updating to branch default + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg -R cloned-bookmarks-update bookmarks + X2 1:925d80f479bb + Y 2:db815d6d32e6 + * Z 2:db815d6d32e6 + x y 2:db815d6d32e6 + create bundle with two heads $ hg clone . tobundle