477 os.mkdir(dstcachedir) |
477 os.mkdir(dstcachedir) |
478 util.copyfile(srcbranchcache, dstbranchcache) |
478 util.copyfile(srcbranchcache, dstbranchcache) |
479 |
479 |
480 def clone(ui, peeropts, source, dest=None, pull=False, revs=None, |
480 def clone(ui, peeropts, source, dest=None, pull=False, revs=None, |
481 update=True, stream=False, branch=None, shareopts=None, |
481 update=True, stream=False, branch=None, shareopts=None, |
482 storeincludepats=None, storeexcludepats=None): |
482 storeincludepats=None, storeexcludepats=None, depth=None): |
483 """Make a copy of an existing repository. |
483 """Make a copy of an existing repository. |
484 |
484 |
485 Create a copy of an existing repository in a new directory. The |
485 Create a copy of an existing repository in a new directory. The |
486 source and destination are URLs, as passed to the repository |
486 source and destination are URLs, as passed to the repository |
487 function. Returns a pair of repository peers, the source and |
487 function. Returns a pair of repository peers, the source and |
747 overrides = {('ui', 'quietbookmarkmove'): True} |
747 overrides = {('ui', 'quietbookmarkmove'): True} |
748 with local.ui.configoverride(overrides, 'clone'): |
748 with local.ui.configoverride(overrides, 'clone'): |
749 exchange.pull(local, srcpeer, revs, |
749 exchange.pull(local, srcpeer, revs, |
750 streamclonerequested=stream, |
750 streamclonerequested=stream, |
751 includepats=storeincludepats, |
751 includepats=storeincludepats, |
752 excludepats=storeexcludepats) |
752 excludepats=storeexcludepats, |
|
753 depth=depth) |
753 elif srcrepo: |
754 elif srcrepo: |
754 # TODO lift restriction once exchange.push() accepts narrow |
755 # TODO lift restriction once exchange.push() accepts narrow |
755 # push. |
756 # push. |
756 if narrow: |
757 if narrow: |
757 raise error.Abort(_('narrow clone not available for ' |
758 raise error.Abort(_('narrow clone not available for ' |