Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 22648:ef62c66bee1b
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.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 26 Sep 2014 13:56:20 -0700 |
parents | 5b6cd8526d56 |
children | d7b114493315 |
comparison
equal
deleted
inserted
replaced
22647:5b6cd8526d56 | 22648:ef62c66bee1b |
---|---|
6 # This software may be used and distributed according to the terms of the | 6 # This software may be used and distributed according to the terms of the |
7 # GNU General Public License version 2 or any later version. | 7 # GNU General Public License version 2 or any later version. |
8 | 8 |
9 from i18n import _ | 9 from i18n import _ |
10 from lock import release | 10 from lock import release |
11 from node import hex, nullid | 11 from node import nullid |
12 import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo | 12 import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo |
13 import bookmarks, lock, util, extensions, error, node, scmutil, phases, url | 13 import bookmarks, lock, util, extensions, error, node, scmutil, phases, url |
14 import cmdutil, discovery, repoview, exchange | 14 import cmdutil, discovery, repoview, exchange |
15 import merge as mergemod | 15 import merge as mergemod |
16 import verify as verifymod | 16 import verify as verifymod |
418 else: | 418 else: |
419 raise util.Abort(_("clone from remote to remote not supported")) | 419 raise util.Abort(_("clone from remote to remote not supported")) |
420 | 420 |
421 cleandir = None | 421 cleandir = None |
422 | 422 |
423 # clone all bookmarks except divergent ones | |
424 destrepo = destpeer.local() | 423 destrepo = destpeer.local() |
425 if destrepo and srcpeer.capable("pushkey"): | |
426 rb = srcpeer.listkeys('bookmarks') | |
427 marks = destrepo._bookmarks | |
428 for k, n in rb.iteritems(): | |
429 try: | |
430 m = destrepo.lookup(n) | |
431 marks[k] = m | |
432 except error.RepoLookupError: | |
433 pass | |
434 if rb: | |
435 marks.write() | |
436 elif srcrepo and destpeer.capable("pushkey"): | |
437 for k, n in srcrepo._bookmarks.iteritems(): | |
438 destpeer.pushkey('bookmarks', k, '', hex(n)) | |
439 | |
440 if destrepo: | 424 if destrepo: |
441 template = ( | 425 template = ( |
442 '# You may want to set your username here if it is not set\n' | 426 '# You may want to set your username here if it is not set\n' |
443 "# globally, or this repository requires a different\n" | 427 "# globally, or this repository requires a different\n" |
444 '# username from your usual configuration. If you want to\n' | 428 '# username from your usual configuration. If you want to\n' |