mercurial/localrepo.py
changeset 2613 479e26afa10f
parent 2612 ffb895f16925
child 2621 5a5852a417b1
equal deleted inserted replaced
2612:ffb895f16925 2613:479e26afa10f
  2223                        (util.bytecount(total_bytes), elapsed,
  2223                        (util.bytecount(total_bytes), elapsed,
  2224                         util.bytecount(total_bytes / elapsed)))
  2224                         util.bytecount(total_bytes / elapsed)))
  2225         self.reload()
  2225         self.reload()
  2226         return len(self.heads()) + 1
  2226         return len(self.heads()) + 1
  2227         
  2227         
  2228     def clone(self, remote, heads=[], pull=False):
  2228     def clone(self, remote, heads=[], stream=False):
  2229         '''clone remote repository.
  2229         '''clone remote repository.
  2230         if possible, changes are streamed from remote server.
       
  2231 
  2230 
  2232         keyword arguments:
  2231         keyword arguments:
  2233         heads: list of revs to clone (forces use of pull)
  2232         heads: list of revs to clone (forces use of pull)
  2234         pull: force use of pull, even if remote can stream'''
  2233         pull: force use of pull, even if remote can stream'''
  2235 
  2234 
  2238 
  2237 
  2239         # if revlog format changes, client will have to check version
  2238         # if revlog format changes, client will have to check version
  2240         # and format flags on "stream" capability, and stream only if
  2239         # and format flags on "stream" capability, and stream only if
  2241         # compatible.
  2240         # compatible.
  2242 
  2241 
  2243         if not pull and not heads and remote.capable('stream'):
  2242         if stream and not heads and remote.capable('stream'):
  2244             return self.stream_in(remote)
  2243             return self.stream_in(remote)
  2245         return self.pull(remote, heads)
  2244         return self.pull(remote, heads)
  2246 
  2245 
  2247 # used to avoid circular references so destructors work
  2246 # used to avoid circular references so destructors work
  2248 def aftertrans(base):
  2247 def aftertrans(base):