tests/test-pull-r
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Tue, 21 Oct 2008 17:00:35 +0200
changeset 7233 9f0e52e1df77
parent 6405 b8346ae5d64b
child 8167 6c82beaaa11a
permissions -rwxr-xr-x
fix pull racing with push/commit (issue1320) changegroup() has a problem when nodes which does not descend from a node in <bases> are added to remote after the discovery phase. If that happens, changegroup() won't send the correct set of nodes, ie. some nodes will be missing. To correct it we have to find the set of nodes that both remote and self have (called <common>), and send all the nodes not in <common>. This fix has some overhead, in the worst case it will re-send a whole branch. A proper fix to avoid this overhead might be to change the protocol so that the <common> nodes are sent (instead of the <bases> of the missing nodes).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5221
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     1
#!/bin/sh
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     2
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     3
hg init repo
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     4
cd repo
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     5
echo foo > foo
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     6
hg ci -qAm 'add foo' -d '0 0'
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     7
echo >> foo
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     8
hg ci -m 'change foo' -d '0 0'
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     9
hg up -qC 0
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    10
echo bar > bar
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    11
hg ci -qAm 'add bar' -d '0 0'
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    12
hg log
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    13
cd ..
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    14
hg init copy
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    15
cd copy
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    16
6405
b8346ae5d64b commands: fix shadowed repo module
Patrick Mezard <pmezard@gmail.com>
parents: 5221
diff changeset
    17
echo '% pull a missing revision'
b8346ae5d64b commands: fix shadowed repo module
Patrick Mezard <pmezard@gmail.com>
parents: 5221
diff changeset
    18
hg pull -qr missing ../repo
b8346ae5d64b commands: fix shadowed repo module
Patrick Mezard <pmezard@gmail.com>
parents: 5221
diff changeset
    19
5221
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    20
echo '% pull -r 0'
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    21
hg pull -qr 0 ../repo
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    22
hg log
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    23
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    24
echo '% pull -r 1'
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    25
hg pull -qr 1 ../repo
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    26
hg log
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    27
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    28
# this used to abort: received changelog group is empty
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    29
echo '% pull -r 1 again'
8ede77c2d008 pull -r: pass the revisions as the heads argument of findincoming
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    30
hg pull -qr 1 ../repo