diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -353,6 +353,21 @@ def clone(ui, peeropts, source, dest=Non if dircleanup: dircleanup.close() + # clone all bookmarks + if destrepo.local() and srcrepo.capable("pushkey"): + rb = srcrepo.listkeys('bookmarks') + for k, n in rb.iteritems(): + try: + m = destrepo.lookup(n) + destrepo._bookmarks[k] = m + except error.RepoLookupError: + pass + if rb: + bookmarks.write(destrepo) + elif srcrepo.local() and destrepo.capable("pushkey"): + for k, n in srcrepo._bookmarks.iteritems(): + destrepo.pushkey('bookmarks', k, '', hex(n)) + if destrepo.local(): fp = destrepo.opener("hgrc", "w", text=True) fp.write("[paths]\n") @@ -381,21 +396,6 @@ def clone(ui, peeropts, source, dest=Non destrepo.ui.status(_("updating to branch %s\n") % bn) _update(destrepo, uprev) - # clone all bookmarks - if destrepo.local() and srcrepo.capable("pushkey"): - rb = srcrepo.listkeys('bookmarks') - for k, n in rb.iteritems(): - try: - m = destrepo.lookup(n) - destrepo._bookmarks[k] = m - except error.RepoLookupError: - pass - if rb: - bookmarks.write(destrepo) - elif srcrepo.local() and destrepo.capable("pushkey"): - for k, n in srcrepo._bookmarks.iteritems(): - destrepo.pushkey('bookmarks', k, '', hex(n)) - return srcrepo, destrepo finally: release(srclock, destlock) diff --git a/tests/test-https.t b/tests/test-https.t --- a/tests/test-https.t +++ b/tests/test-https.t @@ -118,9 +118,9 @@ clone via pull adding manifests adding file changes added 1 changesets with 4 changes to 4 files + warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting) updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved - warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting) $ hg verify -R copy-pull checking changesets checking manifests