diff -r cc24e4ed3e0c -r dbdb8aa70503 mercurial/hg.py --- a/mercurial/hg.py Wed Nov 30 16:53:44 2011 -0600 +++ b/mercurial/hg.py Fri Nov 04 10:18:40 2011 +0100 @@ -353,6 +353,21 @@ 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 @@ 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)