##// END OF EJS Templates
localrepo: remove clone method by hoisting into hg.py...
Augie Fackler -
r27165:70884715 default
parent child Browse files
Show More
@@ -546,13 +546,22 b' def clone(ui, peeropts, source, dest=Non'
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())
@@ -1856,22 +1856,6 b' class localrepository(object):'
1856 """
1856 """
1857 return util.hooks()
1857 return util.hooks()
1858
1858
1859 def clone(self, remote, heads=[], stream=None):
1860 '''clone remote repository.
1861
1862 keyword arguments:
1863 heads: list of revs to clone (forces use of pull)
1864 stream: use streaming clone if possible'''
1865 # internal config: ui.quietbookmarkmove
1866 quiet = self.ui.backupconfig('ui', 'quietbookmarkmove')
1867 try:
1868 self.ui.setconfig('ui', 'quietbookmarkmove', True, 'clone')
1869 pullop = exchange.pull(self, remote, heads,
1870 streamclonerequested=stream)
1871 return pullop.cgresult
1872 finally:
1873 self.ui.restoreconfig(quiet)
1874
1875 def pushkey(self, namespace, key, old, new):
1859 def pushkey(self, namespace, key, old, new):
1876 try:
1860 try:
1877 tr = self.currenttransaction()
1861 tr = self.currenttransaction()
General Comments 0
You need to be logged in to leave comments. Login now