clone: activate bookmark specified with --updaterev stable
authorThomas Arendsen Hein <thomas@intevation.de>
Tue, 02 Oct 2012 09:26:42 +0200
branchstable
changeset 17703 4a07d2ff7c66
parent 17698 6647ac9b9044
child 17704 3d1a781b23c0
child 17705 6929b9c70be9
clone: activate bookmark specified with --updaterev
mercurial/hg.py
tests/test-bookmarks.t
--- a/mercurial/hg.py	Mon Oct 01 23:11:28 2012 -0500
+++ b/mercurial/hg.py	Tue Oct 02 09:26:42 2012 +0200
@@ -410,6 +410,8 @@
                 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:
--- a/tests/test-bookmarks.t	Mon Oct 01 23:11:28 2012 -0500
+++ b/tests/test-bookmarks.t	Tue Oct 02 09:26:42 2012 +0200
@@ -336,6 +336,17 @@
   $ 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