# HG changeset patch # User Kevin Bullock # Date 1332365978 18000 # Node ID 6b16ded5c810704eaad3335efd76611cc801c3f6 # Parent 1228b5528945ac5b9f160015166785a479d7c7a3 bookmarks: clone non-divergent bookmarks with @ in them diff -r 1228b5528945 -r 6b16ded5c810 mercurial/bookmarks.py --- a/mercurial/bookmarks.py Wed Mar 21 17:24:15 2012 +0900 +++ b/mercurial/bookmarks.py Wed Mar 21 16:39:38 2012 -0500 @@ -169,7 +169,7 @@ d = {} for k, v in marks.iteritems(): # don't expose local divergent bookmarks - if '@' not in k and not k.endswith('@'): + if '@' not in k or k.endswith('@'): d[k] = hex(v) return d diff -r 1228b5528945 -r 6b16ded5c810 mercurial/hg.py --- a/mercurial/hg.py Wed Mar 21 17:24:15 2012 +0900 +++ b/mercurial/hg.py Wed Mar 21 16:39:38 2012 -0500 @@ -356,7 +356,7 @@ if dircleanup: dircleanup.close() - # clone all bookmarks + # clone all bookmarks except divergent ones if destrepo.local() and srcrepo.capable("pushkey"): rb = srcrepo.listkeys('bookmarks') for k, n in rb.iteritems(): diff -r 1228b5528945 -r 6b16ded5c810 tests/test-bookmarks.t --- a/tests/test-bookmarks.t Wed Mar 21 17:24:15 2012 +0900 +++ b/tests/test-bookmarks.t Wed Mar 21 16:39:38 2012 -0500 @@ -269,18 +269,24 @@ test clone + $ hg bookmark -r 2 -i @ + $ hg bookmark -r 2 -i a@ $ hg bookmarks + @ 2:db815d6d32e6 X2 1:925d80f479bb Y 2:db815d6d32e6 * Z 2:db815d6d32e6 + a@ 2:db815d6d32e6 x y 2:db815d6d32e6 $ hg clone . cloned-bookmarks updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R cloned-bookmarks bookmarks + @ 2:db815d6d32e6 X2 1:925d80f479bb Y 2:db815d6d32e6 Z 2:db815d6d32e6 + a@ 2:db815d6d32e6 x y 2:db815d6d32e6 test clone with pull protocol @@ -294,11 +300,16 @@ updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R cloned-bookmarks-pull bookmarks + @ 2:db815d6d32e6 X2 1:925d80f479bb Y 2:db815d6d32e6 Z 2:db815d6d32e6 + a@ 2:db815d6d32e6 x y 2:db815d6d32e6 + $ hg bookmark -d @ + $ hg bookmark -d a@ + test clone with a specific revision $ hg clone -r 925d80 . cloned-bookmarks-rev