Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 23546:deabbe7ed54b
localrepo.clone: add a way to override server preferuncompressed
Without this patch, if the server sets preferuncompressed, there's no way for
clients to override that and force a non-streaming clone. With this patch, we
extend the meaning of --pull to also override preferuncompressed and force a
non-streaming clone.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 12 Dec 2014 14:06:36 -0800 |
parents | acc73273b27e |
children | 3198aac7a95d |
comparison
equal
deleted
inserted
replaced
23545:68c434799559 | 23546:deabbe7ed54b |
---|---|
1724 self.invalidate() | 1724 self.invalidate() |
1725 return len(self.heads()) + 1 | 1725 return len(self.heads()) + 1 |
1726 finally: | 1726 finally: |
1727 lock.release() | 1727 lock.release() |
1728 | 1728 |
1729 def clone(self, remote, heads=[], stream=False): | 1729 def clone(self, remote, heads=[], stream=None): |
1730 '''clone remote repository. | 1730 '''clone remote repository. |
1731 | 1731 |
1732 keyword arguments: | 1732 keyword arguments: |
1733 heads: list of revs to clone (forces use of pull) | 1733 heads: list of revs to clone (forces use of pull) |
1734 stream: use streaming clone if possible''' | 1734 stream: use streaming clone if possible''' |
1739 | 1739 |
1740 # if revlog format changes, client will have to check version | 1740 # if revlog format changes, client will have to check version |
1741 # and format flags on "stream" capability, and use | 1741 # and format flags on "stream" capability, and use |
1742 # uncompressed only if compatible. | 1742 # uncompressed only if compatible. |
1743 | 1743 |
1744 if not stream: | 1744 if stream is None: |
1745 # if the server explicitly prefers to stream (for fast LANs) | 1745 # if the server explicitly prefers to stream (for fast LANs) |
1746 stream = remote.capable('stream-preferred') | 1746 stream = remote.capable('stream-preferred') |
1747 | 1747 |
1748 if stream and not heads: | 1748 if stream and not heads: |
1749 # 'stream' means remote revlog format is revlogv1 only | 1749 # 'stream' means remote revlog format is revlogv1 only |