changeset 4147:88e922eca4e2

pullbundle: deal with head in a predicable order We use node order to make this repeatable from one clone to another. This is an arbitrary pick.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 26 Sep 2018 18:42:44 +0200
parents f7aa0ecae3a4
children 5ef93dbace5e
files hgext3rd/pullbundle.py tests/test-pullbundle.t
diffstat 2 files changed, 326 insertions(+), 360 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/pullbundle.py	Wed Sep 26 17:17:11 2018 +0200
+++ b/hgext3rd/pullbundle.py	Wed Sep 26 18:42:44 2018 +0200
@@ -184,7 +184,7 @@
 
     missingrevs = set(rev(n) for n in outgoing.missing)
     allslices = []
-    missingheads = [rev(n) for n in outgoing.missingheads]
+    missingheads = [rev(n) for n in sorted(outgoing.missingheads, reverse=True)]
     for head in missingheads:
         localslices = []
         localmissing = set(repo.revs('%ld and ::%d', missingrevs, head))
--- a/tests/test-pullbundle.t	Wed Sep 26 17:17:11 2018 +0200
+++ b/tests/test-pullbundle.t	Wed Sep 26 18:42:44 2018 +0200
@@ -257,26 +257,25 @@
   pulling from server
   searching for changes
   all local heads known remotely
-  pullbundle-cache: "missing" set sliced into 19 subranges in *.* seconds (glob)
+  pullbundle-cache: "missing" set sliced into 18 subranges in *.* seconds (glob)
   1 changesets found
   4 changesets found
   8 changesets found
-  3 changesets found
-  29 changesets found
-  256 changesets found
-  256 changesets found
-  64 changesets found
-  8 changesets found
-  1 changesets found
-  4 changesets found
-  8 changesets found
-  16 changesets found
+  32 changesets found
   128 changesets found
   64 changesets found
   32 changesets found
   8 changesets found
   4 changesets found
   2 changesets found
+  1 changesets found
+  4 changesets found
+  8 changesets found
+  16 changesets found
+  256 changesets found
+  256 changesets found
+  64 changesets found
+  8 changesets found
   uncompressed size of bundle content:
        188 (changelog)
          4 (manifests)
@@ -287,34 +286,7 @@
       1476 (changelog)
          4 (manifests)
   uncompressed size of bundle content:
-       556 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-      5340 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-     47108 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-     47108 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-     11780 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-      1476 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-       188 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-       740 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-      1476 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-      2948 (changelog)
+      5892 (changelog)
          4 (manifests)
   uncompressed size of bundle content:
      23556 (changelog)
@@ -334,6 +306,30 @@
   uncompressed size of bundle content:
        372 (changelog)
          4 (manifests)
+  uncompressed size of bundle content:
+       188 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+       740 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+      1476 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+      2948 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+     47108 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+     47108 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+     11780 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+      1476 (changelog)
+         4 (manifests)
   adding changesets
   adding manifests
   adding file changes
@@ -349,43 +345,7 @@
   adding changesets
   adding manifests
   adding file changes
-  added 3 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 29 changesets with 0 changes to 0 files (+1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 256 changesets with 0 changes to 0 files (-1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 256 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 64 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 0 changes to 0 files (+1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 4 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 16 changesets with 0 changes to 0 files
+  added 32 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
   adding file changes
@@ -410,7 +370,39 @@
   adding manifests
   adding file changes
   added 2 changesets with 0 changes to 0 files
-  new changesets 17185c1c22f1:1dded5aafa0f
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 16 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 64 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  new changesets 17185c1c22f1:0f376356904f
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
   $ mv newbundles oldbundles
@@ -418,7 +410,7 @@
   $ diff -u oldbundles newbundles
   --- oldbundles	* (glob)
   +++ newbundles	* (glob)
-  @@ -1,6 +1,25 @@
+  @@ -1,6 +1,24 @@
   +02-0f376356904fc8c1c6ceaac27990f2fd79b1f8c1-0000001856skip-0000000008size.hg
   +02-17185c1c22f1266b084daf7cfb07b6ebbfbc65ab-0000001235skip-0000000001size.hg
   +02-1dded5aafa0f8d548f6357cc2f8882dcc4489fbf-0000001516skip-0000000002size.hg
@@ -426,20 +418,19 @@
   +02-2f0e261a08964bc1c607c0eda4978364c22a9b94-0000001504skip-0000000008size.hg
    02-467b6e370e816747e27de0d0b9237f4090a33656-0000001152skip-0000000064size.hg
   +02-484c46df3e41f371efd0ff74fa5221657527213f-0000001240skip-0000000008size.hg
-  +02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001264skip-0000000016size.hg
+  +02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001248skip-0000000032size.hg
    02-540f762640ee62ca597ece26af725e6357e82805-0000000000skip-0000001024size.hg
-  +02-5eaa75df73c454c1afff722301a4c73e897de94d-0000001256skip-0000000008size.hg
    02-63ded94ceab180ac2fa13e1f0beeb4d2265998a3-0000001232skip-0000000002size.hg
   +02-694ef7e5b2984f1ec66c3d960799f4ff2459672c-0000001236skip-0000000004size.hg
    02-7f3a79522d6e904d52aea07c71e6cb612667e8f4-0000001216skip-0000000016size.hg
+  +02-89fab188d2ce3c4cde6be031f2fc5b9b4ff248e3-0000000900skip-0000000004size.hg
+  +02-97ede4832194ed56894374f2a1cc7a0022b486da-0000000904skip-0000000008size.hg
   +02-b2d350c94c26edbb783aaa21fc24f1fc65c30e74-0000001536skip-0000000256size.hg
   +02-bbd293bd171fd5b711d428db46940a72eca7a40f-0000001280skip-0000000128size.hg
-  +02-ca970a853ea24846035ccb324cc8de49ef768748-0000001252skip-0000000004size.hg
-  +02-d1807e3513890ac71c2e8d10e9dc9a5b58b15d4b-0000001251skip-0000000001size.hg
-  +02-d83212ecaa436c80d6113cf915ba35e2db787e79-0000001248skip-0000000003size.hg
+  +02-c72277ff25807eb444fa48a60afb434d78c21f2f-0000000899skip-0000000001size.hg
   +02-da87a81c5310760f414a933e6550b7e8e60cf241-0000001792skip-0000000064size.hg
   +02-dba2fddbf3c28198659046674a512afd616a1519-0000001472skip-0000000032size.hg
-  +02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000899skip-0000000029size.hg
+  +02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000912skip-0000000016size.hg
   +02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001280skip-0000000256size.hg
    02-ee2deecf044fa5583f66188c9177b0f13332adc2-0000001024skip-0000000128size.hg
    02-f864bc82f6a2f2ecb49b83722e0895f9d657b0dd-0000001234skip-0000000001size.hg
@@ -514,26 +505,25 @@
   pulling from server
   searching for changes
   all local heads known remotely
-  pullbundle-cache: "missing" set sliced into 19 subranges in *.* seconds (glob)
+  pullbundle-cache: "missing" set sliced into 18 subranges in *.* seconds (glob)
   1 changesets found in caches
   4 changesets found in caches
   8 changesets found in caches
-  3 changesets found in caches
-  29 changesets found in caches
-  256 changesets found in caches
-  256 changesets found in caches
-  64 changesets found in caches
-  8 changesets found in caches
-  1 changesets found in caches
-  4 changesets found in caches
-  8 changesets found in caches
-  16 changesets found in caches
+  32 changesets found in caches
   128 changesets found in caches
   64 changesets found in caches
   32 changesets found in caches
   8 changesets found in caches
   4 changesets found in caches
   2 changesets found in caches
+  1 changesets found in caches
+  4 changesets found in caches
+  8 changesets found in caches
+  16 changesets found in caches
+  256 changesets found in caches
+  256 changesets found in caches
+  64 changesets found in caches
+  8 changesets found in caches
   adding changesets
   adding manifests
   adding file changes
@@ -549,43 +539,7 @@
   adding changesets
   adding manifests
   adding file changes
-  added 3 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 29 changesets with 0 changes to 0 files (+1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 256 changesets with 0 changes to 0 files (-1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 256 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 64 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 0 changes to 0 files (+1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 4 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 16 changesets with 0 changes to 0 files
+  added 32 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
   adding file changes
@@ -610,7 +564,39 @@
   adding manifests
   adding file changes
   added 2 changesets with 0 changes to 0 files
-  new changesets 17185c1c22f1:1dded5aafa0f
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 16 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 64 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  new changesets 17185c1c22f1:0f376356904f
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
   $ mv newbundles oldbundles
@@ -639,7 +625,7 @@
   pullbundle-cache: "missing" set sliced into 9 subranges in *.* seconds (glob)
   1024 changesets found in caches
   227 changesets found
-  29 changesets found in caches
+  29 changesets found
   128 changesets found
   64 changesets found
   32 changesets found
@@ -650,6 +636,9 @@
      41772 (changelog)
          4 (manifests)
   uncompressed size of bundle content:
+      5340 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
      23556 (changelog)
          4 (manifests)
   uncompressed size of bundle content:
@@ -711,33 +700,33 @@
   $ diff -u oldbundles newbundles
   --- oldbundles	* (glob)
   +++ newbundles	* (glob)
-  @@ -3,21 +3,28 @@
+  @@ -3,20 +3,28 @@
    02-1dded5aafa0f8d548f6357cc2f8882dcc4489fbf-0000001516skip-0000000002size.hg
    02-2dc4f1ab9029719714b8e0dde8e3725a5bb28472-0000001408skip-0000000064size.hg
    02-2f0e261a08964bc1c607c0eda4978364c22a9b94-0000001504skip-0000000008size.hg
   +02-44e80141ad530a2aa085e9bd9b5311b57eff72ff-0000001522skip-0000000001size.hg
    02-467b6e370e816747e27de0d0b9237f4090a33656-0000001152skip-0000000064size.hg
    02-484c46df3e41f371efd0ff74fa5221657527213f-0000001240skip-0000000008size.hg
-   02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001264skip-0000000016size.hg
+   02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001248skip-0000000032size.hg
    02-540f762640ee62ca597ece26af725e6357e82805-0000000000skip-0000001024size.hg
   +02-59e60b258b18cde1e931cf30ce4ae62b49e37abd-0000001520skip-0000000002size.hg
-   02-5eaa75df73c454c1afff722301a4c73e897de94d-0000001256skip-0000000008size.hg
    02-63ded94ceab180ac2fa13e1f0beeb4d2265998a3-0000001232skip-0000000002size.hg
    02-694ef7e5b2984f1ec66c3d960799f4ff2459672c-0000001236skip-0000000004size.hg
   +02-7a55a4d5ce324910842c893b56173cf2a847cb9d-0000001472skip-0000000032size.hg
    02-7f3a79522d6e904d52aea07c71e6cb612667e8f4-0000001216skip-0000000016size.hg
+   02-89fab188d2ce3c4cde6be031f2fc5b9b4ff248e3-0000000900skip-0000000004size.hg
+   02-97ede4832194ed56894374f2a1cc7a0022b486da-0000000904skip-0000000008size.hg
   +02-a4ab7df9d74053fb819c8a1c6a48ad605cc05f8a-0000001504skip-0000000016size.hg
    02-b2d350c94c26edbb783aaa21fc24f1fc65c30e74-0000001536skip-0000000256size.hg
    02-bbd293bd171fd5b711d428db46940a72eca7a40f-0000001280skip-0000000128size.hg
   +02-c12927fef661d2463043347101b90067c2961333-0000001280skip-0000000128size.hg
-   02-ca970a853ea24846035ccb324cc8de49ef768748-0000001252skip-0000000004size.hg
-   02-d1807e3513890ac71c2e8d10e9dc9a5b58b15d4b-0000001251skip-0000000001size.hg
+   02-c72277ff25807eb444fa48a60afb434d78c21f2f-0000000899skip-0000000001size.hg
   +02-d83212ecaa436c80d6113cf915ba35e2db787e79-0000001024skip-0000000227size.hg
-   02-d83212ecaa436c80d6113cf915ba35e2db787e79-0000001248skip-0000000003size.hg
    02-da87a81c5310760f414a933e6550b7e8e60cf241-0000001792skip-0000000064size.hg
    02-dba2fddbf3c28198659046674a512afd616a1519-0000001472skip-0000000032size.hg
   +02-dc714c3a5d080165292ba99b097567d0b95e5756-0000001408skip-0000000064size.hg
-   02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000899skip-0000000029size.hg
+  +02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000899skip-0000000029size.hg
+   02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000912skip-0000000016size.hg
    02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001280skip-0000000256size.hg
    02-ee2deecf044fa5583f66188c9177b0f13332adc2-0000001024skip-0000000128size.hg
   [1]
@@ -761,19 +750,19 @@
   1 changesets found
   4 changesets found
   8 changesets found
-  256 changesets found in caches
-  64 changesets found in caches
-  8 changesets found in caches
-  1 changesets found in caches
-  4 changesets found in caches
-  8 changesets found in caches
-  16 changesets found in caches
+  16 changesets found
   128 changesets found in caches
   64 changesets found in caches
   32 changesets found in caches
   8 changesets found in caches
   4 changesets found in caches
   2 changesets found in caches
+  1 changesets found
+  4 changesets found
+  8 changesets found
+  256 changesets found in caches
+  64 changesets found in caches
+  8 changesets found in caches
   uncompressed size of bundle content:
        188 (changelog)
          4 (manifests)
@@ -783,30 +772,18 @@
   uncompressed size of bundle content:
       1476 (changelog)
          4 (manifests)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 4 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 256 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 64 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
+  uncompressed size of bundle content:
+      2948 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+       188 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+       740 (changelog)
+         4 (manifests)
+  uncompressed size of bundle content:
+      1476 (changelog)
+         4 (manifests)
   adding changesets
   adding manifests
   adding file changes
@@ -847,7 +824,31 @@
   adding manifests
   adding file changes
   added 2 changesets with 0 changes to 0 files
-  new changesets c232505f58fd:1dded5aafa0f
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 64 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  new changesets d1807e351389:0f376356904f
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
   $ mv newbundles oldbundles
@@ -855,7 +856,7 @@
   $ diff -u oldbundles newbundles
   --- oldbundles	* (glob)
   +++ newbundles	* (glob)
-  @@ -1,6 +1,7 @@
+  @@ -1,14 +1,17 @@
    02-0f376356904fc8c1c6ceaac27990f2fd79b1f8c1-0000001856skip-0000000008size.hg
    02-17185c1c22f1266b084daf7cfb07b6ebbfbc65ab-0000001235skip-0000000001size.hg
    02-1dded5aafa0f8d548f6357cc2f8882dcc4489fbf-0000001516skip-0000000002size.hg
@@ -863,17 +864,30 @@
    02-2dc4f1ab9029719714b8e0dde8e3725a5bb28472-0000001408skip-0000000064size.hg
    02-2f0e261a08964bc1c607c0eda4978364c22a9b94-0000001504skip-0000000008size.hg
    02-44e80141ad530a2aa085e9bd9b5311b57eff72ff-0000001522skip-0000000001size.hg
-  @@ -18,6 +19,7 @@
+   02-467b6e370e816747e27de0d0b9237f4090a33656-0000001152skip-0000000064size.hg
+   02-484c46df3e41f371efd0ff74fa5221657527213f-0000001240skip-0000000008size.hg
+   02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001248skip-0000000032size.hg
+  +02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001264skip-0000000016size.hg
+   02-540f762640ee62ca597ece26af725e6357e82805-0000000000skip-0000001024size.hg
+   02-59e60b258b18cde1e931cf30ce4ae62b49e37abd-0000001520skip-0000000002size.hg
+  +02-5eaa75df73c454c1afff722301a4c73e897de94d-0000001256skip-0000000008size.hg
+   02-63ded94ceab180ac2fa13e1f0beeb4d2265998a3-0000001232skip-0000000002size.hg
+   02-694ef7e5b2984f1ec66c3d960799f4ff2459672c-0000001236skip-0000000004size.hg
+   02-7a55a4d5ce324910842c893b56173cf2a847cb9d-0000001472skip-0000000032size.hg
+  @@ -19,7 +22,10 @@
    02-b2d350c94c26edbb783aaa21fc24f1fc65c30e74-0000001536skip-0000000256size.hg
    02-bbd293bd171fd5b711d428db46940a72eca7a40f-0000001280skip-0000000128size.hg
    02-c12927fef661d2463043347101b90067c2961333-0000001280skip-0000000128size.hg
   +02-c232505f58fdf70bcf5f6ab6a555f23ffc74f761-0000001523skip-0000000001size.hg
-   02-ca970a853ea24846035ccb324cc8de49ef768748-0000001252skip-0000000004size.hg
-   02-d1807e3513890ac71c2e8d10e9dc9a5b58b15d4b-0000001251skip-0000000001size.hg
+   02-c72277ff25807eb444fa48a60afb434d78c21f2f-0000000899skip-0000000001size.hg
+  +02-ca970a853ea24846035ccb324cc8de49ef768748-0000001252skip-0000000004size.hg
+  +02-d1807e3513890ac71c2e8d10e9dc9a5b58b15d4b-0000001251skip-0000000001size.hg
    02-d83212ecaa436c80d6113cf915ba35e2db787e79-0000001024skip-0000000227size.hg
-  @@ -27,6 +29,7 @@
-   02-dc714c3a5d080165292ba99b097567d0b95e5756-0000001408skip-0000000064size.hg
+   02-da87a81c5310760f414a933e6550b7e8e60cf241-0000001792skip-0000000064size.hg
+   02-dba2fddbf3c28198659046674a512afd616a1519-0000001472skip-0000000032size.hg
+  @@ -27,6 +33,7 @@
    02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000899skip-0000000029size.hg
+   02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000912skip-0000000016size.hg
    02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001280skip-0000000256size.hg
   +02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001528skip-0000000008size.hg
    02-ee2deecf044fa5583f66188c9177b0f13332adc2-0000001024skip-0000000128size.hg
@@ -887,24 +901,25 @@
   $ hg -R client4 pull --verbose server | grep -v 'add changeset'
   pulling from server
   requesting all changes
-  pullbundle-cache: "missing" set sliced into 15 subranges in *.* seconds (glob)
+  pullbundle-cache: "missing" set sliced into 16 subranges in *.* seconds (glob)
   1024 changesets found in caches
-  512 changesets found
-  256 changesets found in caches
-  64 changesets found in caches
-  8 changesets found in caches
-  1 changesets found in caches
-  4 changesets found in caches
-  8 changesets found in caches
-  16 changesets found in caches
+  256 changesets found
   128 changesets found in caches
   64 changesets found in caches
   32 changesets found in caches
   8 changesets found in caches
   4 changesets found in caches
   2 changesets found in caches
+  1 changesets found in caches
+  4 changesets found in caches
+  8 changesets found in caches
+  16 changesets found in caches
+  256 changesets found in caches
+  256 changesets found in caches
+  64 changesets found in caches
+  8 changesets found in caches
   uncompressed size of bundle content:
-     94212 (changelog)
+     47108 (changelog)
          4 (manifests)
   adding changesets
   adding manifests
@@ -913,38 +928,10 @@
   adding changesets
   adding manifests
   adding file changes
-  added 512 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
   added 256 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
   adding file changes
-  added 64 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 0 changes to 0 files (+1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 4 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 16 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
   added 128 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
@@ -966,7 +953,39 @@
   adding manifests
   adding file changes
   added 2 changesets with 0 changes to 0 files
-  new changesets 1ea73414a91b:1dded5aafa0f
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 16 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 64 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  new changesets 1ea73414a91b:0f376356904f
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
   $ mv newbundles oldbundles
@@ -974,14 +993,14 @@
   $ diff -u oldbundles newbundles
   --- oldbundles	* (glob)
   +++ newbundles	* (glob)
-  @@ -28,6 +28,7 @@
-   02-dba2fddbf3c28198659046674a512afd616a1519-0000001472skip-0000000032size.hg
-   02-dc714c3a5d080165292ba99b097567d0b95e5756-0000001408skip-0000000064size.hg
-   02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000899skip-0000000029size.hg
-  +02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001024skip-0000000512size.hg
-   02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001280skip-0000000256size.hg
-   02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001528skip-0000000008size.hg
-   02-ee2deecf044fa5583f66188c9177b0f13332adc2-0000001024skip-0000000128size.hg
+  @@ -7,6 +7,7 @@
+   02-44e80141ad530a2aa085e9bd9b5311b57eff72ff-0000001522skip-0000000001size.hg
+   02-467b6e370e816747e27de0d0b9237f4090a33656-0000001152skip-0000000064size.hg
+   02-484c46df3e41f371efd0ff74fa5221657527213f-0000001240skip-0000000008size.hg
+  +02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001024skip-0000000256size.hg
+   02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001248skip-0000000032size.hg
+   02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001264skip-0000000016size.hg
+   02-540f762640ee62ca597ece26af725e6357e82805-0000000000skip-0000001024size.hg
   [1]
 
 Pull with piece "not linear from head"
@@ -1025,10 +1044,10 @@
      23300 (changelog)
          4 (manifests)
   uncompressed size of bundle content:
-       732 (changelog)
+       734 (changelog)
          4 (manifests)
   uncompressed size of bundle content:
-       188 (changelog)
+       186 (changelog)
          4 (manifests)
   adding changesets
   adding manifests
@@ -1050,40 +1069,32 @@
   adding manifests
   adding file changes
   added 1 changesets with 0 changes to 0 files (+1 heads)
-  new changesets 1ea73414a91b:c72277ff2580
+  new changesets 1ea73414a91b:c31a4e0cc28d
   (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg -R test-local-missing pull server --verbose
   pulling from server
   searching for changes
   all local heads known remotely
-  pullbundle-cache: "missing" set sliced into 27 subranges in *.* seconds (glob)
+  pullbundle-cache: "missing" set sliced into 19 subranges in *.* seconds (glob)
   4 changesets found
   8 changesets found
   16 changesets found
   32 changesets found
   64 changesets found
-  128 changesets found in caches
-  64 changesets found in caches
-  32 changesets found
-  2 changesets found
-  1 changesets found
-  4 changesets found
-  8 changesets found
-  16 changesets found
   256 changesets found in caches
-  256 changesets found in caches
-  64 changesets found in caches
-  8 changesets found in caches
-  1 changesets found in caches
-  4 changesets found in caches
-  8 changesets found in caches
-  16 changesets found in caches
   128 changesets found in caches
   64 changesets found in caches
   32 changesets found in caches
   8 changesets found in caches
   4 changesets found in caches
   2 changesets found in caches
+  4 changesets found in caches
+  8 changesets found in caches
+  16 changesets found in caches
+  256 changesets found in caches
+  256 changesets found in caches
+  64 changesets found in caches
+  8 changesets found in caches
   uncompressed size of bundle content:
        732 (changelog)
          4 (manifests)
@@ -1099,24 +1110,6 @@
   uncompressed size of bundle content:
      11700 (changelog)
          4 (manifests)
-  uncompressed size of bundle content:
-      5892 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-       372 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-       188 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-       740 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-      1476 (changelog)
-         4 (manifests)
-  uncompressed size of bundle content:
-      2948 (changelog)
-         4 (manifests)
   adding changesets
   adding manifests
   adding file changes
@@ -1140,70 +1133,10 @@
   adding changesets
   adding manifests
   adding file changes
-  added 128 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 64 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 32 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 2 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 4 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 16 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 256 changesets with 0 changes to 0 files (-1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
   added 256 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
   adding file changes
-  added 64 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 0 changes to 0 files (+1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 4 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 16 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
   added 128 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
@@ -1225,7 +1158,35 @@
   adding manifests
   adding file changes
   added 2 changesets with 0 changes to 0 files
-  new changesets e600b80a2fc8:1dded5aafa0f
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 16 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 64 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  new changesets e600b80a2fc8:0f376356904f
   (run 'hg update' to get a working copy)
 
 Test cache setting
@@ -1242,7 +1203,7 @@
 
   $ hg clone --pull server other-cache-directory
   requesting all changes
-  pullbundle-cache: "missing" set sliced into 15 subranges in *.* seconds (glob)
+  pullbundle-cache: "missing" set sliced into 16 subranges in *.* seconds (glob)
   adding changesets
   adding manifests
   adding file changes
@@ -1250,38 +1211,10 @@
   adding changesets
   adding manifests
   adding file changes
-  added 512 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
   added 256 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
   adding file changes
-  added 64 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 0 changes to 0 files (+1 heads)
-  adding changesets
-  adding manifests
-  adding file changes
-  added 4 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 8 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
-  added 16 changesets with 0 changes to 0 files
-  adding changesets
-  adding manifests
-  adding file changes
   added 128 changesets with 0 changes to 0 files
   adding changesets
   adding manifests
@@ -1303,7 +1236,39 @@
   adding manifests
   adding file changes
   added 2 changesets with 0 changes to 0 files
-  new changesets 1ea73414a91b:1dded5aafa0f
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 0 files (+1 heads)
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 16 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 256 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 64 changesets with 0 changes to 0 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 0 changes to 0 files
+  new changesets 1ea73414a91b:0f376356904f
   updating to branch default
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
@@ -1312,14 +1277,15 @@
   02-1dded5aafa0f8d548f6357cc2f8882dcc4489fbf-0000001516skip-0000000002size.hg
   02-2dc4f1ab9029719714b8e0dde8e3725a5bb28472-0000001408skip-0000000064size.hg
   02-2f0e261a08964bc1c607c0eda4978364c22a9b94-0000001504skip-0000000008size.hg
-  02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001264skip-0000000016size.hg
+  02-4a6d0f7d07d060b026d9fc690cd89cd26af96e42-0000001024skip-0000000256size.hg
   02-540f762640ee62ca597ece26af725e6357e82805-0000000000skip-0000001024size.hg
-  02-5eaa75df73c454c1afff722301a4c73e897de94d-0000001256skip-0000000008size.hg
+  02-89fab188d2ce3c4cde6be031f2fc5b9b4ff248e3-0000000900skip-0000000004size.hg
+  02-97ede4832194ed56894374f2a1cc7a0022b486da-0000000904skip-0000000008size.hg
   02-b2d350c94c26edbb783aaa21fc24f1fc65c30e74-0000001536skip-0000000256size.hg
   02-bbd293bd171fd5b711d428db46940a72eca7a40f-0000001280skip-0000000128size.hg
-  02-ca970a853ea24846035ccb324cc8de49ef768748-0000001252skip-0000000004size.hg
-  02-d1807e3513890ac71c2e8d10e9dc9a5b58b15d4b-0000001251skip-0000000001size.hg
+  02-c72277ff25807eb444fa48a60afb434d78c21f2f-0000000899skip-0000000001size.hg
   02-da87a81c5310760f414a933e6550b7e8e60cf241-0000001792skip-0000000064size.hg
   02-dba2fddbf3c28198659046674a512afd616a1519-0000001472skip-0000000032size.hg
-  02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001024skip-0000000512size.hg
+  02-e469a7aa5cce57653b6b02ff46c80b2d94d62629-0000000912skip-0000000016size.hg
+  02-e74670ea99533967c5d90da3ddbc0318cc1fd502-0000001280skip-0000000256size.hg
   02-fb6c210a224903e81e5a8d2ee099cb0c9526ba8c-0000001512skip-0000000004size.hg