Show More
@@ -846,7 +846,7 b' class pulloperation(object):' | |||||
846 | """ |
|
846 | """ | |
847 |
|
847 | |||
848 | def __init__(self, repo, remote, heads=None, force=False, bookmarks=(), |
|
848 | def __init__(self, repo, remote, heads=None, force=False, bookmarks=(), | |
849 | remotebookmarks=None): |
|
849 | remotebookmarks=None, streamclonerequested=None): | |
850 | # repo we pull into |
|
850 | # repo we pull into | |
851 | self.repo = repo |
|
851 | self.repo = repo | |
852 | # repo we pull from |
|
852 | # repo we pull from | |
@@ -857,6 +857,8 b' class pulloperation(object):' | |||||
857 | self.explicitbookmarks = bookmarks |
|
857 | self.explicitbookmarks = bookmarks | |
858 | # do we force pull? |
|
858 | # do we force pull? | |
859 | self.force = force |
|
859 | self.force = force | |
|
860 | # whether a streaming clone was requested | |||
|
861 | self.streamclonerequested = streamclonerequested | |||
860 | # transaction manager |
|
862 | # transaction manager | |
861 | self.trmanager = None |
|
863 | self.trmanager = None | |
862 | # set of common changeset between local and remote before pull |
|
864 | # set of common changeset between local and remote before pull | |
@@ -924,7 +926,8 b' class transactionmanager(object):' | |||||
924 | if self._tr is not None: |
|
926 | if self._tr is not None: | |
925 | self._tr.release() |
|
927 | self._tr.release() | |
926 |
|
928 | |||
927 |
def pull(repo, remote, heads=None, force=False, bookmarks=(), opargs=None |
|
929 | def pull(repo, remote, heads=None, force=False, bookmarks=(), opargs=None, | |
|
930 | streamclonerequested=None): | |||
928 | """Fetch repository data from a remote. |
|
931 | """Fetch repository data from a remote. | |
929 |
|
932 | |||
930 | This is the main function used to retrieve data from a remote repository. |
|
933 | This is the main function used to retrieve data from a remote repository. | |
@@ -937,13 +940,18 b' def pull(repo, remote, heads=None, force' | |||||
937 | default, all remote bookmarks are pulled. |
|
940 | default, all remote bookmarks are pulled. | |
938 | ``opargs`` are additional keyword arguments to pass to ``pulloperation`` |
|
941 | ``opargs`` are additional keyword arguments to pass to ``pulloperation`` | |
939 | initialization. |
|
942 | initialization. | |
|
943 | ``streamclonerequested`` is a boolean indicating whether a "streaming | |||
|
944 | clone" is requested. A "streaming clone" is essentially a raw file copy | |||
|
945 | of revlogs from the server. This only works when the local repository is | |||
|
946 | empty. The default value of ``None`` means to respect the server | |||
|
947 | configuration for preferring stream clones. | |||
940 |
|
948 | |||
941 | Returns the ``pulloperation`` created for this pull. |
|
949 | Returns the ``pulloperation`` created for this pull. | |
942 | """ |
|
950 | """ | |
943 | if opargs is None: |
|
951 | if opargs is None: | |
944 | opargs = {} |
|
952 | opargs = {} | |
945 | pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks, |
|
953 | pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks, | |
946 | **opargs) |
|
954 | streamclonerequested=streamclonerequested, **opargs) | |
947 | if pullop.remote.local(): |
|
955 | if pullop.remote.local(): | |
948 | missing = set(pullop.remote.requirements) - pullop.repo.supported |
|
956 | missing = set(pullop.remote.requirements) - pullop.repo.supported | |
949 | if missing: |
|
957 | if missing: |
@@ -1800,10 +1800,11 b' class localrepository(object):' | |||||
1800 | quiet = self.ui.backupconfig('ui', 'quietbookmarkmove') |
|
1800 | quiet = self.ui.backupconfig('ui', 'quietbookmarkmove') | |
1801 | try: |
|
1801 | try: | |
1802 | self.ui.setconfig('ui', 'quietbookmarkmove', True, 'clone') |
|
1802 | self.ui.setconfig('ui', 'quietbookmarkmove', True, 'clone') | |
1803 |
|
|
1803 | pullop = exchange.pull(self, remote, heads, | |
|
1804 | streamclonerequested=stream) | |||
|
1805 | return pullop.cgresult | |||
1804 | finally: |
|
1806 | finally: | |
1805 | self.ui.restoreconfig(quiet) |
|
1807 | self.ui.restoreconfig(quiet) | |
1806 | return ret |
|
|||
1807 |
|
1808 | |||
1808 | def pushkey(self, namespace, key, old, new): |
|
1809 | def pushkey(self, namespace, key, old, new): | |
1809 | try: |
|
1810 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now