[PATCH] clone: update to @ bookmark if it exists

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Aug 28 10:51:59 CDT 2012


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1332366819 18000
# Node ID 579afc1a4378a55f64f6fd185f3de40da5bfbb4a
# Parent  99a2a4ae35e2180b7f825ef2677c36d538eac4ba
clone: update to @ bookmark if it exists

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -399,7 +399,7 @@ def clone(ui, peeropts, source, dest=Non
             if update:
                 if update is not True:
                     checkout = srcpeer.lookup(update)
-                for test in (checkout, 'default', 'tip'):
+                for test in (checkout, '@', 'default', 'tip'):
                     if test is None:
                         continue
                     try:
diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -468,6 +468,16 @@ iterable in addbranchrevs()
   $ rm -r ua
 
 
+Test clone with special '@' bookmark:
+  $ cd a
+  $ hg bookmark -r a7949464abda @  # branch point of stable from default
+  $ hg clone . ../i
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg id -i ../i
+  a7949464abda
+
+
 Testing failures:
 
   $ mkdir fail


More information about the Mercurial-devel mailing list