# HG changeset patch # User Pierre-Yves David # Date 1411764980 25200 # Node ID ef62c66bee1bcd57bc6cca7297a1defa891097e6 # Parent 5b6cd8526d56932b68479848fc749d7a11727c93 clone: remove duplicated bookmark pulling Now that all clone methods (copy, pull and push) also transport bookmarks, we can safely drop the manual pulling that was performed during clone. diff -r 5b6cd8526d56 -r ef62c66bee1b mercurial/hg.py --- a/mercurial/hg.py Fri Sep 26 15:15:49 2014 -0700 +++ b/mercurial/hg.py Fri Sep 26 13:56:20 2014 -0700 @@ -8,7 +8,7 @@ from i18n import _ from lock import release -from node import hex, nullid +from node import nullid import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo import bookmarks, lock, util, extensions, error, node, scmutil, phases, url import cmdutil, discovery, repoview, exchange @@ -420,23 +420,7 @@ cleandir = None - # clone all bookmarks except divergent ones destrepo = destpeer.local() - if destrepo and srcpeer.capable("pushkey"): - rb = srcpeer.listkeys('bookmarks') - marks = destrepo._bookmarks - for k, n in rb.iteritems(): - try: - m = destrepo.lookup(n) - marks[k] = m - except error.RepoLookupError: - pass - if rb: - marks.write() - elif srcrepo and destpeer.capable("pushkey"): - for k, n in srcrepo._bookmarks.iteritems(): - destpeer.pushkey('bookmarks', k, '', hex(n)) - if destrepo: template = ( '# You may want to set your username here if it is not set\n' diff -r 5b6cd8526d56 -r ef62c66bee1b tests/test-clone.t --- a/tests/test-clone.t Fri Sep 26 15:15:49 2014 -0700 +++ b/tests/test-clone.t Fri Sep 26 13:56:20 2014 -0700 @@ -64,7 +64,6 @@ #if hardlink $ hg --debug clone -U . ../c linked 8 files - listing keys for "bookmarks" #else $ hg --debug clone -U . ../c copied 8 files diff -r 5b6cd8526d56 -r ef62c66bee1b tests/test-hardlinks.t --- a/tests/test-hardlinks.t Fri Sep 26 15:15:49 2014 -0700 +++ b/tests/test-hardlinks.t Fri Sep 26 13:56:20 2014 -0700 @@ -57,7 +57,6 @@ $ hg clone -U --debug r1 r2 linked 7 files - listing keys for "bookmarks" Create non-hardlinked clone r3: diff -r 5b6cd8526d56 -r ef62c66bee1b tests/test-http-proxy.t --- a/tests/test-http-proxy.t Fri Sep 26 15:15:49 2014 -0700 +++ b/tests/test-http-proxy.t Fri Sep 26 13:56:20 2014 -0700 @@ -101,29 +101,23 @@ * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) + *- - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) + *- - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) + *- - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) + *- - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob) - * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) - diff -r 5b6cd8526d56 -r ef62c66bee1b tests/test-http.t --- a/tests/test-http.t Fri Sep 26 15:15:49 2014 -0700 +++ b/tests/test-http.t Fri Sep 26 13:56:20 2014 -0700 @@ -251,7 +251,6 @@ "GET /?cmd=branchmap HTTP/1.1" 200 - "GET /?cmd=stream_out HTTP/1.1" 401 - "GET /?cmd=stream_out HTTP/1.1" 200 - - "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces