comparison mercurial/hg.py @ 27165:70884715725e

localrepo: remove clone method by hoisting into hg.py hg.py was the only remaining caller of localrepo.clone(), so it's time to move some more behavior out of localrepo.
author Augie Fackler <augie@google.com>
date Wed, 11 Nov 2015 19:47:49 -0500
parents 1aee2ab0f902
children 43c00ca887d1
comparison
equal deleted inserted replaced
27164:88d5db4b155c 27165:70884715725e
544 raise error.Abort(_("src repository does not support " 544 raise error.Abort(_("src repository does not support "
545 "revision lookup and so doesn't " 545 "revision lookup and so doesn't "
546 "support clone by revision")) 546 "support clone by revision"))
547 revs = [srcpeer.lookup(r) for r in rev] 547 revs = [srcpeer.lookup(r) for r in rev]
548 checkout = revs[0] 548 checkout = revs[0]
549 if destpeer.local(): 549 local = destpeer.local()
550 if local:
550 if not stream: 551 if not stream:
551 if pull: 552 if pull:
552 stream = False 553 stream = False
553 else: 554 else:
554 stream = None 555 stream = None
555 destpeer.local().clone(srcpeer, heads=revs, stream=stream) 556 # internal config: ui.quietbookmarkmove
557 quiet = local.ui.backupconfig('ui', 'quietbookmarkmove')
558 try:
559 local.ui.setconfig(
560 'ui', 'quietbookmarkmove', True, 'clone')
561 exchange.pull(local, srcpeer, revs,
562 streamclonerequested=stream)
563 finally:
564 local.ui.restoreconfig(quiet)
556 elif srcrepo: 565 elif srcrepo:
557 exchange.push(srcrepo, destpeer, revs=revs, 566 exchange.push(srcrepo, destpeer, revs=revs,
558 bookmarks=srcrepo._bookmarks.keys()) 567 bookmarks=srcrepo._bookmarks.keys())
559 else: 568 else:
560 raise error.Abort(_("clone from remote to remote not supported") 569 raise error.Abort(_("clone from remote to remote not supported")