Commits

Benoit Boissinot  committed 60b42f3

clone: no race possible, we can use changegroup() and have smaller urls

Related to issue2126

  • Participants
  • Parent commits 07dbafd
  • Branches stable

Comments (0)

Files changed (2)

File mercurial/localrepo.py

         try:
             common, fetch, rheads = self.findcommonincoming(remote, heads=heads,
                                                             force=force)
-            if fetch == [nullid]:
-                self.ui.status(_("requesting all changes\n"))
-
             if not fetch:
                 self.ui.status(_("no changes found\n"))
                 return 0
 
-            if heads is None and remote.capable('changegroupsubset'):
+            if fetch == [nullid]:
+                self.ui.status(_("requesting all changes\n"))
+            elif heads is None and remote.capable('changegroupsubset'):
+                # issue1320, avoid a race if remote changed after discovery
                 heads = rheads
 
             if heads is None:

File tests/test-http-proxy.out

 XXX "GET http://localhost:/?cmd=stream_out HTTP/1.1" - -
 XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
 XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=capabilities HTTP/1.1" - -
-XXX "GET http://localhost:/?bases=0000000000000000000000000000000000000000&cmd=changegroupsubset&heads=83180e7845de420a1bb46896fd5fe05294f8d629 HTTP/1.1" - -
+XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -
 XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
 XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=capabilities HTTP/1.1" - -
-XXX "GET http://localhost:/?bases=0000000000000000000000000000000000000000&cmd=changegroupsubset&heads=83180e7845de420a1bb46896fd5fe05294f8d629 HTTP/1.1" - -
+XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -
 XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
 XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=capabilities HTTP/1.1" - -
-XXX "GET http://localhost:/?bases=0000000000000000000000000000000000000000&cmd=changegroupsubset&heads=83180e7845de420a1bb46896fd5fe05294f8d629 HTTP/1.1" - -
+XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -
 XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
 XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=capabilities HTTP/1.1" - -
-XXX "GET http://localhost:/?bases=0000000000000000000000000000000000000000&cmd=changegroupsubset&heads=83180e7845de420a1bb46896fd5fe05294f8d629 HTTP/1.1" - -
+XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -