view tests/test-sidedata-exchange.t @ 48068:bf8837e3d7ce

dirstate: Remove the flat Rust DirstateMap implementation Before this changeset we had two Rust implementations of `DirstateMap`. This removes the "flat" DirstateMap so that the "tree" DirstateMap is always used when Rust enabled. This simplifies the code a lot, and will enable (in the next changeset) further removal of a trait abstraction. This is a performance regression when: * Rust is enabled, and * The repository uses the legacy dirstate-v1 file format, and * For `hg status`, unknown files are not listed (such as with `-mard`) The regression is about 100 milliseconds for `hg status -mard` on a semi-large repository (mozilla-central), from ~320ms to ~420ms. We deem this to be small enough to be worth it. The new dirstate-v2 is still experimental at this point, but we aim to stabilize it (though not yet enable it by default for new repositories) in Mercurial 6.0. Eventually, upgrating repositories to dirsate-v2 will eliminate this regression (and enable other performance improvements). # Background The flat DirstateMap was introduced with the first Rust implementation of the status algorithm. It works similarly to the previous Python + C one, with a single `HashMap` that associates file paths to a `DirstateEntry` (where Python has a dict). We later added the tree DirstateMap where the root of the tree contains nodes for files and directories that are directly at the root of the repository, and nodes for directories can contain child nodes representing the files and directly that *they* contain directly. The shape of this tree mirrors that of the working directory in the filesystem. This enables the status algorithm to traverse this tree in tandem with traversing the filesystem tree, which in turns enables a more efficient algorithm. Furthermore, the new dirstate-v2 file format is also based on a tree of the same shape. The tree DirstateMap can access a dirstate-v2 file without parsing it: binary data in a single large (possibly memory-mapped) bytes buffer is traversed on demand. This allows `DirstateMap` creation to take `O(1)` time. (Mutation works by creating new in-memory nodes with copy-on-write semantics, and serialization is append-mostly.) The tradeoff is that for "legacy" repositories that use the dirstate-v1 file format, parsing that file into a tree DirstateMap takes more time. Profiling shows that this time is dominated by `HashMap`. For a dirstate containing `F` files with an average `D` directory depth, the flat DirstateMap does parsing in `O(F)` number of HashMap operations but the tree DirstateMap in `O(F × D)` operations, since each node has its own HashMap containing its child nodes. This slower costs ~140ms on an old snapshot of mozilla-central, and ~80ms on an old snapshot of the Netbeans repository. The status algorithm is faster, but with `-mard` (when not listing unknown files) it is typically not faster *enough* to compensate the slower parsing. Both Rust implementations are always faster than the Python + C implementation # Benchmark results All benchmarks are run on changeset 98c0408324e6, with repositories that use the dirstate-v1 file format, on a server with 4 CPU cores and 4 CPU threads (no HyperThreading). `hg status` benchmarks show wall clock times of the entire command as the average and standard deviation of serveral runs, collected by https://github.com/sharkdp/hyperfine and reformated. Parsing benchmarks are wall clock time of the Rust function that converts a bytes buffer of the dirstate file into the `DirstateMap` data structure as used by the status algorithm. A single run each, collected by running `hg status` this environment variable: RUST_LOG=hg::dirstate::dirstate_map=trace,hg::dirstate_tree::dirstate_map=trace Benchmark 1: Rust flat DirstateMap → Rust tree DirstateMap hg status mozilla-clean 562.3 ms ± 2.0 ms → 462.5 ms ± 0.6 ms 1.22 ± 0.00 times faster mozilla-dirty 859.6 ms ± 2.2 ms → 719.5 ms ± 3.2 ms 1.19 ± 0.01 times faster mozilla-ignored 558.2 ms ± 3.0 ms → 457.9 ms ± 2.9 ms 1.22 ± 0.01 times faster mozilla-unknowns 859.4 ms ± 5.7 ms → 716.0 ms ± 4.7 ms 1.20 ± 0.01 times faster netbeans-clean 336.5 ms ± 0.9 ms → 339.5 ms ± 0.4 ms 0.99 ± 0.00 times faster netbeans-dirty 491.4 ms ± 1.6 ms → 475.1 ms ± 1.2 ms 1.03 ± 0.00 times faster netbeans-ignored 343.7 ms ± 1.0 ms → 347.8 ms ± 0.4 ms 0.99 ± 0.00 times faster netbeans-unknowns 484.3 ms ± 1.0 ms → 466.0 ms ± 1.2 ms 1.04 ± 0.00 times faster hg status -mard mozilla-clean 317.3 ms ± 0.6 ms → 422.5 ms ± 1.2 ms 0.75 ± 0.00 times faster mozilla-dirty 315.4 ms ± 0.6 ms → 417.7 ms ± 1.1 ms 0.76 ± 0.00 times faster mozilla-ignored 314.6 ms ± 0.6 ms → 417.4 ms ± 1.0 ms 0.75 ± 0.00 times faster mozilla-unknowns 312.9 ms ± 0.9 ms → 417.3 ms ± 1.6 ms 0.75 ± 0.00 times faster netbeans-clean 212.0 ms ± 0.6 ms → 283.6 ms ± 0.8 ms 0.75 ± 0.00 times faster netbeans-dirty 211.4 ms ± 1.0 ms → 283.4 ms ± 1.6 ms 0.75 ± 0.01 times faster netbeans-ignored 211.4 ms ± 0.9 ms → 283.9 ms ± 0.8 ms 0.74 ± 0.01 times faster netbeans-unknowns 211.1 ms ± 0.6 ms → 283.4 ms ± 1.0 ms 0.74 ± 0.00 times faster Parsing mozilla-clean 38.4ms → 177.6ms mozilla-dirty 38.8ms → 177.0ms mozilla-ignored 38.8ms → 178.0ms mozilla-unknowns 38.7ms → 176.9ms netbeans-clean 16.5ms → 97.3ms netbeans-dirty 16.5ms → 98.4ms netbeans-ignored 16.9ms → 97.4ms netbeans-unknowns 16.9ms → 96.3ms Benchmark 2: Python + C dirstatemap → Rust tree DirstateMap hg status mozilla-clean 1261.0 ms ± 3.6 ms → 461.1 ms ± 0.5 ms 2.73 ± 0.00 times faster mozilla-dirty 2293.4 ms ± 9.1 ms → 719.6 ms ± 3.6 ms 3.19 ± 0.01 times faster mozilla-ignored 1240.4 ms ± 2.3 ms → 457.7 ms ± 1.9 ms 2.71 ± 0.00 times faster mozilla-unknowns 2283.3 ms ± 9.0 ms → 719.7 ms ± 3.8 ms 3.17 ± 0.01 times faster netbeans-clean 879.7 ms ± 3.5 ms → 339.9 ms ± 0.5 ms 2.59 ± 0.00 times faster netbeans-dirty 1257.3 ms ± 4.7 ms → 474.6 ms ± 1.6 ms 2.65 ± 0.01 times faster netbeans-ignored 943.9 ms ± 1.9 ms → 347.3 ms ± 1.1 ms 2.72 ± 0.00 times faster netbeans-unknowns 1188.1 ms ± 5.0 ms → 465.2 ms ± 2.3 ms 2.55 ± 0.01 times faster hg status -mard mozilla-clean 903.2 ms ± 3.6 ms → 423.4 ms ± 2.2 ms 2.13 ± 0.01 times faster mozilla-dirty 884.6 ms ± 4.5 ms → 417.3 ms ± 1.4 ms 2.12 ± 0.01 times faster mozilla-ignored 881.9 ms ± 1.3 ms → 417.3 ms ± 0.8 ms 2.11 ± 0.00 times faster mozilla-unknowns 878.5 ms ± 1.9 ms → 416.4 ms ± 0.9 ms 2.11 ± 0.00 times faster netbeans-clean 434.9 ms ± 1.8 ms → 284.0 ms ± 0.8 ms 1.53 ± 0.01 times faster netbeans-dirty 434.1 ms ± 0.8 ms → 283.1 ms ± 0.8 ms 1.53 ± 0.00 times faster netbeans-ignored 431.7 ms ± 1.1 ms → 283.6 ms ± 1.8 ms 1.52 ± 0.01 times faster netbeans-unknowns 433.0 ms ± 1.3 ms → 283.5 ms ± 0.7 ms 1.53 ± 0.00 times faster Differential Revision: https://phab.mercurial-scm.org/D11516
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 27 Sep 2021 12:09:15 +0200
parents 0dedd3d063b0
children
line wrap: on
line source

===========================
Tests for sidedata exchange
===========================

Check simple exchange behavior
==============================

Pusher and pushed have sidedata enabled
---------------------------------------

  $ hg init sidedata-source --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> sidedata-source/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata-5.py
  > EOF
  $ hg init sidedata-target --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> sidedata-target/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata-5.py
  > EOF
  $ cd sidedata-source
  $ echo a > a
  $ echo b > b
  $ echo c > c
  $ hg commit -Am "initial"
  adding a
  adding b
  adding c
  $ echo aa > a
  $ hg commit -m "other"
  $ hg push -r . ../sidedata-target
  pushing to ../sidedata-target
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 4 changes to 3 files
  $ hg -R ../sidedata-target debugsidedata -c 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg -R ../sidedata-target debugsidedata -c 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x00:'
   entry-0002 size 32
    '\xa3\xee4v\x99\x85$\x9f\x1f\x8dKe\x0f\xc3\x9d-\xc9\xb5%[\x15=h\xe9\xf2O\xb5\xd9\x1f*\xff\xe5'
  $ hg -R ../sidedata-target debugsidedata -m 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg -R ../sidedata-target debugsidedata -m 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x00\x81'
   entry-0002 size 32
    '-bL\xc5\xa4uu"#\xac\x1b`,\xc0\xbc\x9d\xf5\xac\xf0\x1d\x89)2\xf8N\xb1\x14m\xce\xd7\xbc\xae'
  $ hg -R ../sidedata-target debugsidedata a 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg -R ../sidedata-target debugsidedata a 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x00\x03'
   entry-0002 size 32
    '\xd9\xcd\x81UvL5C\xf1\x0f\xad\x8aH\rt17Fo\x8dU!<\x8e\xae\xfc\xd1/\x06\xd4:\x80'
  $ cd ..

Puller and pulled have sidedata enabled
---------------------------------------

  $ rm -rf sidedata-source sidedata-target
  $ hg init sidedata-source --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> sidedata-source/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata-5.py
  > EOF
  $ hg init sidedata-target --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> sidedata-target/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata-5.py
  > EOF
  $ cd sidedata-source
  $ echo a > a
  $ echo b > b
  $ echo c > c
  $ hg commit -Am "initial"
  adding a
  adding b
  adding c
  $ echo aa > a
  $ hg commit -m "other"
  $ hg pull -R ../sidedata-target ../sidedata-source
  pulling from ../sidedata-source
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 4 changes to 3 files
  new changesets 05da661850d7:7ec8b4049447
  (run 'hg update' to get a working copy)
  $ hg -R ../sidedata-target debugsidedata -c 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg -R ../sidedata-target debugsidedata -c 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x00:'
   entry-0002 size 32
    '\xa3\xee4v\x99\x85$\x9f\x1f\x8dKe\x0f\xc3\x9d-\xc9\xb5%[\x15=h\xe9\xf2O\xb5\xd9\x1f*\xff\xe5'
  $ hg -R ../sidedata-target debugsidedata -m 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg -R ../sidedata-target debugsidedata -m 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x00\x81'
   entry-0002 size 32
    '-bL\xc5\xa4uu"#\xac\x1b`,\xc0\xbc\x9d\xf5\xac\xf0\x1d\x89)2\xf8N\xb1\x14m\xce\xd7\xbc\xae'
  $ hg -R ../sidedata-target debugsidedata a 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg -R ../sidedata-target debugsidedata a 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x00\x03'
   entry-0002 size 32
    '\xd9\xcd\x81UvL5C\xf1\x0f\xad\x8aH\rt17Fo\x8dU!<\x8e\xae\xfc\xd1/\x06\xd4:\x80'
  $ cd ..

Now on to asymmetric configs.

Pusher has sidedata enabled, pushed does not
--------------------------------------------

  $ rm -rf sidedata-source sidedata-target
  $ hg init sidedata-source --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> sidedata-source/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata-5.py
  > EOF
  $ hg init sidedata-target --config experimental.revlogv2=no
  $ cd sidedata-source
  $ echo a > a
  $ echo b > b
  $ echo c > c
  $ hg commit -Am "initial"
  adding a
  adding b
  adding c
  $ echo aa > a
  $ hg commit -m "other"
  $ hg push -r . ../sidedata-target --traceback
  pushing to ../sidedata-target
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 4 changes to 3 files
  $ hg -R ../sidedata-target log -G
  o  changeset:   1:7ec8b4049447
  |  tag:         tip
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     other
  |
  o  changeset:   0:05da661850d7
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     initial
  

  $ hg -R ../sidedata-target debugsidedata -c 0
  $ hg -R ../sidedata-target debugsidedata -c 1 -v
  $ hg -R ../sidedata-target debugsidedata -m 0
  $ hg -R ../sidedata-target debugsidedata -m 1 -v
  $ hg -R ../sidedata-target debugsidedata a 0
  $ hg -R ../sidedata-target debugsidedata a 1 -v
  $ cd ..

Pulled has sidedata enabled, puller does not
--------------------------------------------

  $ rm -rf sidedata-source sidedata-target
  $ hg init sidedata-source --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> sidedata-source/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata-5.py
  > EOF
  $ hg init sidedata-target --config experimental.revlogv2=no
  $ cd sidedata-source
  $ echo a > a
  $ echo b > b
  $ echo c > c
  $ hg commit -Am "initial"
  adding a
  adding b
  adding c
  $ echo aa > a
  $ hg commit -m "other"
  $ hg pull -R ../sidedata-target ../sidedata-source
  pulling from ../sidedata-source
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 4 changes to 3 files
  new changesets 05da661850d7:7ec8b4049447
  (run 'hg update' to get a working copy)
  $ hg -R ../sidedata-target log -G
  o  changeset:   1:7ec8b4049447
  |  tag:         tip
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     other
  |
  o  changeset:   0:05da661850d7
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     initial
  

  $ hg -R ../sidedata-target debugsidedata -c 0
  $ hg -R ../sidedata-target debugsidedata -c 1 -v
  $ hg -R ../sidedata-target debugsidedata -m 0
  $ hg -R ../sidedata-target debugsidedata -m 1 -v
  $ hg -R ../sidedata-target debugsidedata a 0
  $ hg -R ../sidedata-target debugsidedata a 1 -v
  $ cd ..


Check sidedata exchange with on-the-fly generation and removal
==============================================================

(Push) Target has strict superset of the source
-----------------------------------------------

  $ hg init source-repo --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ hg init target-repo --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> target-repo/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata.py
  > EOF
  $ cd source-repo
  $ echo aaa > a
  $ hg add a
  $ hg commit -m a
  $ echo aaa > b
  $ hg add b
  $ hg commit -m b
  $ echo xxx >> a
  $ hg commit -m aa

No sidedata is generated in the source
  $ hg debugsidedata -c 0

Check that sidedata capabilities are advertised
  $ hg debugcapabilities ../target-repo | grep sidedata
    exp-wanted-sidedata=1,2

We expect the client to abort the push since it's not capable of generating
what the server is asking
  $ hg push -r . ../target-repo
  pushing to ../target-repo
  abort: cannot push: required sidedata category not supported by this client: '1'
  [255]

Add the required capabilities
  $ cat << EOF >> .hg/hgrc
  > [extensions]
  > testsidedata2=$TESTDIR/testlib/ext-sidedata-2.py
  > EOF

We expect the target to have sidedata that was generated by the source on push
  $ hg push -r . ../target-repo
  pushing to ../target-repo
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 3 changes to 2 files
  $ cd ../target-repo
  $ hg debugsidedata -c 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg debugsidedata -c 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x006'
   entry-0002 size 32
    '\x98\t\xf9\xc4v\xf0\xc5P\x90\xf7wRf\xe8\xe27e\xfc\xc1\x93\xa4\x96\xd0\x1d\x97\xaaG\x1d\xd7t\xfa\xde'
  $ hg debugsidedata -m 2
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg debugsidedata a 1
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ cd ..

(Push) Difference is not subset/superset
----------------------------------------

Source has one in common, one missing and one more sidedata category with the
target.

  $ rm -rf source-repo target-repo
  $ hg init source-repo --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> source-repo/.hg/hgrc
  > [extensions]
  > testsidedata3=$TESTDIR/testlib/ext-sidedata-3.py
  > EOF
  $ hg init target-repo --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> target-repo/.hg/hgrc
  > [extensions]
  > testsidedata4=$TESTDIR/testlib/ext-sidedata-4.py
  > EOF
  $ cd source-repo
  $ echo aaa > a
  $ hg add a
  $ hg commit -m a
  $ echo aaa > b
  $ hg add b
  $ hg commit -m b
  $ echo xxx >> a
  $ hg commit -m aa

Check that sidedata capabilities are advertised
  $ hg debugcapabilities . | grep sidedata
    exp-wanted-sidedata=1,2
  $ hg debugcapabilities ../target-repo | grep sidedata
    exp-wanted-sidedata=2,3

Sidedata is generated in the source, but only the right categories (entry-0001 and entry-0002)
  $ hg debugsidedata -c 0
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg debugsidedata -c 1 -v
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x006'
   entry-0002 size 32
    '\x98\t\xf9\xc4v\xf0\xc5P\x90\xf7wRf\xe8\xe27e\xfc\xc1\x93\xa4\x96\xd0\x1d\x97\xaaG\x1d\xd7t\xfa\xde'
  $ hg debugsidedata -m 2
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg debugsidedata a 1
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32


We expect the target to have sidedata that was generated by the source on push,
and also removed the sidedata categories that are not supported by the target.
Namely, we expect entry-0002 (only exchanged) and entry-0003 (generated),
but not entry-0001.

  $ hg push -r . ../target-repo --traceback
  pushing to ../target-repo
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 3 changes to 2 files
  $ cd ../target-repo
  $ hg log -G
  o  changeset:   2:40f977031323
  |  tag:         tip
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     aa
  |
  o  changeset:   1:2707720c6597
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     b
  |
  o  changeset:   0:7049e48789d7
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     a
  
  $ hg debugsidedata -c 0
  2 sidedata entries
   entry-0002 size 32
   entry-0003 size 48
  $ hg debugsidedata -c 1 -v
  2 sidedata entries
   entry-0002 size 32
    '\x98\t\xf9\xc4v\xf0\xc5P\x90\xf7wRf\xe8\xe27e\xfc\xc1\x93\xa4\x96\xd0\x1d\x97\xaaG\x1d\xd7t\xfa\xde'
   entry-0003 size 48
    '\x87\xcf\xdfI/\xb5\xed\xeaC\xc1\xf0S\xf3X\x1c\xcc\x00m\xee\xe6#\xc1\xe3\xcaB8Fk\x82e\xfc\xc01\xf6\xb7\xb9\xb3([\xf6D\xa6\xcf\x9b\xea\x11{\x08'
  $ hg debugsidedata -m 2
  2 sidedata entries
   entry-0002 size 32
   entry-0003 size 48
  $ hg debugsidedata a 1
  2 sidedata entries
   entry-0002 size 32
   entry-0003 size 48
  $ cd ..

(Pull) Target has strict superset of the source
-----------------------------------------------

  $ rm -rf source-repo target-repo
  $ hg init source-repo --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ hg init target-repo --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
  $ cat << EOF >> target-repo/.hg/hgrc
  > [extensions]
  > testsidedata=$TESTDIR/testlib/ext-sidedata.py
  > EOF
  $ cd source-repo
  $ echo aaa > a
  $ hg add a
  $ hg commit -m a
  $ echo aaa > b
  $ hg add b
  $ hg commit -m b
  $ echo xxx >> a
  $ hg commit -m aa

No sidedata is generated in the source
  $ hg debugsidedata -c 0

Check that sidedata capabilities are advertised
  $ hg debugcapabilities ../target-repo | grep sidedata
    exp-wanted-sidedata=1,2

  $ cd ../target-repo

Add the required capabilities
  $ cat << EOF >> .hg/hgrc
  > [extensions]
  > testsidedata2=$TESTDIR/testlib/ext-sidedata-2.py
  > EOF

We expect the target to have sidedata that it generated on-the-fly during pull
  $ hg pull -r . ../source-repo  --traceback
  pulling from ../source-repo
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 3 changes to 2 files
  new changesets 7049e48789d7:40f977031323
  (run 'hg update' to get a working copy)
  $ hg debugsidedata -c 0 --traceback
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg debugsidedata -c 1 -v --traceback
  2 sidedata entries
   entry-0001 size 4
    '\x00\x00\x006'
   entry-0002 size 32
    '\x98\t\xf9\xc4v\xf0\xc5P\x90\xf7wRf\xe8\xe27e\xfc\xc1\x93\xa4\x96\xd0\x1d\x97\xaaG\x1d\xd7t\xfa\xde'
  $ hg debugsidedata -m 2
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ hg debugsidedata a 1
  2 sidedata entries
   entry-0001 size 4
   entry-0002 size 32
  $ cd ..