comparison mercurial/localrepo.py @ 10863:60b42f318a6d stable

clone: no race possible, we can use changegroup() and have smaller urls Related to issue2126
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 06 Apr 2010 00:45:53 +0200
parents 1e819576e926
children 8bc4ad7e34c8 a9702c47a19f
comparison
equal deleted inserted replaced
10838:07dbafd3a0e2 10863:60b42f318a6d
1452 def pull(self, remote, heads=None, force=False): 1452 def pull(self, remote, heads=None, force=False):
1453 lock = self.lock() 1453 lock = self.lock()
1454 try: 1454 try:
1455 common, fetch, rheads = self.findcommonincoming(remote, heads=heads, 1455 common, fetch, rheads = self.findcommonincoming(remote, heads=heads,
1456 force=force) 1456 force=force)
1457 if fetch == [nullid]:
1458 self.ui.status(_("requesting all changes\n"))
1459
1460 if not fetch: 1457 if not fetch:
1461 self.ui.status(_("no changes found\n")) 1458 self.ui.status(_("no changes found\n"))
1462 return 0 1459 return 0
1463 1460
1464 if heads is None and remote.capable('changegroupsubset'): 1461 if fetch == [nullid]:
1462 self.ui.status(_("requesting all changes\n"))
1463 elif heads is None and remote.capable('changegroupsubset'):
1464 # issue1320, avoid a race if remote changed after discovery
1465 heads = rheads 1465 heads = rheads
1466 1466
1467 if heads is None: 1467 if heads is None:
1468 cg = remote.changegroup(fetch, 'pull') 1468 cg = remote.changegroup(fetch, 'pull')
1469 else: 1469 else: