tests/test-bundle
author Henrik Stuart <henrik.stuart@edlund.dk>
Sat, 23 May 2009 17:02:49 +0200
changeset 8562 e3495c399006
parent 8167 6c82beaaa11a
child 8936 1de6e7e1bb9f
permissions -rwxr-xr-x
named branches: server branchmap wire protocol support (issue736) The repository command, 'branchmap', returns a dictionary, branchname -> [branchheads], and will be implemented for localrepo, httprepo and sshrepo. The following wire format is used for returning data: branchname1 branch1head2 branch1head2 ... branchname2 ... ... Branch names are URL encoded to escape white space, and branch heads are sent as hex encoded node ids. All branches and all their heads are sent. The background and motivation for this command is the desire for a richer named branch semantics when pushing changesets. The details are explained in the original proposal which is included below. 1. BACKGROUND The algorithm currently implemented in Mercurial only considers the graph theoretical heads when determining whether new heads are created, rather than using the branch heads as a count (the algorithm considers a branch head effectively closed when it is merged into another branch or a new named branch is started from that point onward). Our particular problem with the algorithm is that we'd like to see the following case working without forcing a push: Upsteam has: (0:dev) ---- (1:dev) \ `--- (2:stable) Someone merges stable into dev: (0:dev) ---- (1:dev) ------(3:dev) \ / `--- (2:stable) --------´ This can be pushed without --force (as it should). Now someone else does some coding on stable (a bug fix, say): (0:dev) ---- (1:dev) ------(3:dev) \ / `--- (2:stable) ---------´---------(4:stable) This time we need --force to push. We allow this to be pushed without using --force by getting all the remote branch heads (by extending the wire protocol with a new function). We would, furthermore, also prefer if it is impossible to push a new branch without --force (or a later --newbranch option so --force isn't shoe-horned into too many disparate functions, if need be), except of course in the case where the remote repository is empty. This is what our patches accomplish. 2. ALTERNATIVES We have, of course, considered some alternatives to reconstructing enough information to decide whether we are creating new remote branch heads, before we added the new wire protocol command. 2.1. LOOKUP ON REMOTE The main alternative is to use the information from remote.heads() and remote.lookup() to try to reconstruct enough graph information to decide whether we are creating new heads. This is not adequate as illustrated below. Remember that each lookup is typically a request-response pair over SSH or HTTP(S). If we have a simple repository at the remote end like this: (0:dev) ---- (1:dev) ---- (3:stable) \ `--- (2:dev) then remote.heads() will yield [2, 3]. Assume we have nodes [0, 1, 2] locally and want to create a new node, 4:dev, as a descendant from (1:dev), which should be OK as 1:dev is a branch head. If we do remote.lookup('dev') we will get [2]. Thus, we can get information about whether a branch exists on the remote server or not, but this does not solve our problem of figuring out whether we are creating new heads or not. Pushing 4:dev ought to be OK, since after the push, we still only have two heads on branch a. Using remote.lookup() and remote.heads() is thus not adequate to consistently decide whether we are creating new remote heads (e.g. in this situation the latter would never return 1:dev). 2.2. USING INCOMING TO RECONSTRUCT THE GRAPH An alternative would be to use information equivalent to hg incoming to get the full remote graph in addition to the local graph. To do this, we would have to get a changegroup(subset) bundle representing the remote end (which may be a substantial amount of data), getting the branch heads from an instantiated bundlerepository, deleting the bundle, and finally, we can compute the prepush logic. While this is backwards compatible, it will cause a possibly substantial slowdown of the push command as it first needs to pull in all changes. 3. FURTHER ARGUMENTS IN FAVOUR OF THE BRANCHMAP WIRE-PROTOCOL EXTENSION Currently, the commands incoming and pull, work based on the tip of a given branch if used with "-r branchname", making it hard to get all revisions of a certain branch only (if it has multiple heads). This can be solved by requesting the remote's branchheads and letting the revisions to be used with the command be these heads. This can be done by extending the commands with a new option, e.g.: hg pull -b branchname which will be turned into the equivalent of: hg pull -r branchhead1 -r branchhead2 -r branchhead3 We have a simple follow-up patch that can do this ready as well (although not submitted yet as it is pending the acceptance of the branch patch). 4. WRAP-UP We generally find that the branchmap wire protocol extension can provide better named branch support to Mercurial. Currently, some things, like the initial push scenario in this mail, are fairly counter-intuitive, and the more often you have to force push, the more it is likely you will get a lot of spurious and unnecessary merge nodes. Also, restricting incoming and pull to all changes on a branch rather than changes on the tip-most head would be a sensible extension to making named branches a first class citizen in Mercurial. Currently, named branches sometimes feel like a late-coming unwanted step-child. We have run it in a production environment for a while, with fewer multiple heads occurring in our repositories and fewer confused users as a result. Also, it fixes the long-standing issue 736. Co-contributor: Sune Foldager <cryo@cyanite.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     1
#!/bin/sh
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     2
4287
ce71da8ab4f5 test-bundle: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4042
diff changeset
     3
cp "$TESTDIR"/printenv.py .
ce71da8ab4f5 test-bundle: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4042
diff changeset
     4
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
     5
echo "====== Setting up test"
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     6
hg init test
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     7
cd test
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     8
echo 0 > afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     9
hg add afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    10
hg commit -m "0.0" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    11
echo 1 >> afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    12
hg commit -m "0.1" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    13
echo 2 >> afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    14
hg commit -m "0.2" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    15
echo 3 >> afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    16
hg commit -m "0.3" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    17
hg update -C 0
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    18
echo 1 >> afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    19
hg commit -m "1.1" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    20
echo 2 >> afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    21
hg commit -m "1.2" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    22
echo "a line" > fred
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    23
echo 3 >> afile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    24
hg add fred
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    25
hg commit -m "1.3" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    26
hg mv afile adifferentfile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    27
hg commit -m "1.3m" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    28
hg update -C 3
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    29
hg mv afile anotherfile
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    30
hg commit -m "0.3m" -d "1000000 0"
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    31
hg verify
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    32
cd ..
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    33
hg init empty
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    34
6171
73b1de288801 Add --all option to bundle command
John Mulligan <phlogistonjohn@yahoo.com>
parents: 6128
diff changeset
    35
echo "====== Bundle --all"
73b1de288801 Add --all option to bundle command
John Mulligan <phlogistonjohn@yahoo.com>
parents: 6128
diff changeset
    36
hg -R test bundle --all all.hg
7853
af062a9fea9b bundlerepo: reintroduce dirstate
Matt Mackall <mpm@selenic.com>
parents: 7141
diff changeset
    37
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    38
echo "====== Bundle test to full.hg"
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    39
hg -R test bundle full.hg empty
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    40
echo "====== Unbundle full.hg in test"
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    41
hg -R test unbundle full.hg
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    42
echo "====== Verify empty"
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    43
hg -R empty heads
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    44
hg -R empty verify
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    45
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    46
echo "====== Pull full.hg into test (using --cwd)"
2738
400a4a502001 pull: allow to pull from bundle file without need for bundle: syntax
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2673
diff changeset
    47
hg --cwd test pull ../full.hg
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    48
echo "====== Pull full.hg into empty (using --cwd)"
2738
400a4a502001 pull: allow to pull from bundle file without need for bundle: syntax
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2673
diff changeset
    49
hg --cwd empty pull ../full.hg
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    50
echo "====== Rollback empty"
2738
400a4a502001 pull: allow to pull from bundle file without need for bundle: syntax
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2673
diff changeset
    51
hg -R empty rollback
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    52
echo "====== Pull full.hg into empty again (using --cwd)"
2738
400a4a502001 pull: allow to pull from bundle file without need for bundle: syntax
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2673
diff changeset
    53
hg --cwd empty pull ../full.hg
400a4a502001 pull: allow to pull from bundle file without need for bundle: syntax
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2673
diff changeset
    54
5664
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    55
echo "====== Pull full.hg into test (using -R)"
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    56
hg -R test pull full.hg
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    57
echo "====== Pull full.hg into empty (using -R)"
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    58
hg -R empty pull full.hg
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    59
echo "====== Rollback empty"
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    60
hg -R empty rollback
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    61
echo "====== Pull full.hg into empty again (using -R)"
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    62
hg -R empty pull full.hg
da72b4d24797 Fix income/pull with bundle and -R (issue 820).
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5663
diff changeset
    63
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    64
echo "====== Log -R full.hg in fresh empty"
3988
9dcf9d45cab8 Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3429
diff changeset
    65
rm -r empty
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    66
hg init empty
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    67
cd empty
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    68
hg -R bundle://../full.hg log
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    69
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    70
echo "====== Pull ../full.hg into empty (with hook)"
2673
109a22f5434a hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2274
diff changeset
    71
echo '[hooks]' >> .hg/hgrc
4287
ce71da8ab4f5 test-bundle: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4042
diff changeset
    72
echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    73
#doesn't work (yet ?)
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    74
#hg -R bundle://../full.hg verify
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    75
hg pull bundle://../full.hg
6128
b3286a92f4bc bundlerepo: test exposing inconsistency of parsed and internal name (issue #821)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5664
diff changeset
    76
echo "====== Rollback empty"
b3286a92f4bc bundlerepo: test exposing inconsistency of parsed and internal name (issue #821)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5664
diff changeset
    77
hg rollback
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    78
cd ..
6128
b3286a92f4bc bundlerepo: test exposing inconsistency of parsed and internal name (issue #821)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5664
diff changeset
    79
echo "====== Log -R bundle:empty+full.hg"
b3286a92f4bc bundlerepo: test exposing inconsistency of parsed and internal name (issue #821)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5664
diff changeset
    80
hg -R bundle:empty+full.hg log --template="{rev} "
b3286a92f4bc bundlerepo: test exposing inconsistency of parsed and internal name (issue #821)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5664
diff changeset
    81
echo ""
b3286a92f4bc bundlerepo: test exposing inconsistency of parsed and internal name (issue #821)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5664
diff changeset
    82
echo "====== Pull full.hg into empty again (using -R; with hook)"
b3286a92f4bc bundlerepo: test exposing inconsistency of parsed and internal name (issue #821)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5664
diff changeset
    83
hg -R empty pull full.hg
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    84
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    85
echo "====== Create partial clones"
3988
9dcf9d45cab8 Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3429
diff changeset
    86
rm -r empty
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    87
hg init empty
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    88
hg clone -r 3 test partial
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    89
hg clone partial partial2
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    90
cd partial
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    91
echo "====== Log -R full.hg in partial"
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    92
hg -R bundle://../full.hg log
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    93
echo "====== Incoming full.hg in partial"
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    94
hg incoming bundle://../full.hg
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    95
echo "====== Outgoing -R full.hg vs partial2 in partial"
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    96
hg -R bundle://../full.hg outgoing ../partial2
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
    97
echo "====== Outgoing -R does-not-exist.hg vs partial2 in partial"
3429
b19360aa21e9 bundlerepo: avoid exception in __del__ when the bundle doesn't exist
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2738
diff changeset
    98
hg -R bundle://../does-not-exist.hg outgoing ../partial2
2274
89b15372df18 tests for bundles and bundlerepo
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    99
cd ..
4042
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   100
6316
ad5baedeee02 Add tests for cloning from a all-history bundle
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6171
diff changeset
   101
echo "====== Direct clone from bundle (all-history)"
ad5baedeee02 Add tests for cloning from a all-history bundle
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6171
diff changeset
   102
hg clone full.hg full-clone
ad5baedeee02 Add tests for cloning from a all-history bundle
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6171
diff changeset
   103
hg -R full-clone heads
ad5baedeee02 Add tests for cloning from a all-history bundle
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6171
diff changeset
   104
rm -r full-clone
ad5baedeee02 Add tests for cloning from a all-history bundle
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6171
diff changeset
   105
4699
a6b62584d0b2 unbundle: accept multiple file arguments
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 4287
diff changeset
   106
# test for http://www.selenic.com/mercurial/bts/issue216
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
   107
echo "====== Unbundle incremental bundles into fresh empty in one go"
4699
a6b62584d0b2 unbundle: accept multiple file arguments
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 4287
diff changeset
   108
rm -r empty
a6b62584d0b2 unbundle: accept multiple file arguments
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 4287
diff changeset
   109
hg init empty
a6b62584d0b2 unbundle: accept multiple file arguments
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 4287
diff changeset
   110
hg -R test bundle --base null -r 0 ../0.hg
a6b62584d0b2 unbundle: accept multiple file arguments
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 4287
diff changeset
   111
hg -R test bundle --base 0    -r 1 ../1.hg
a6b62584d0b2 unbundle: accept multiple file arguments
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 4287
diff changeset
   112
hg -R empty unbundle -u ../0.hg ../1.hg
a6b62584d0b2 unbundle: accept multiple file arguments
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents: 4287
diff changeset
   113
4042
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   114
# test for 540d1059c802
5663
99fdef2e6793 Add output markers to test-bundle so it's easier to spot the source of
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 4699
diff changeset
   115
echo "====== test for 540d1059c802"
4042
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   116
hg init orig
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   117
cd orig
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   118
echo foo > foo
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   119
hg add foo
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 7853
diff changeset
   120
hg ci -m 'add foo'
4042
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   121
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   122
hg clone . ../copy
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 7853
diff changeset
   123
hg tag foo
4042
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   124
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   125
cd ../copy
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   126
echo >> foo
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 7853
diff changeset
   127
hg ci -m 'change foo'
4042
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   128
hg bundle ../bundle.hg ../orig
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   129
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   130
cd ../orig
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   131
hg incoming ../bundle.hg
f6f65a8d8ed3 add test for 540d1059c802
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3988
diff changeset
   132
cd ..
7141
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   133
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   134
# test for http://www.selenic.com/mercurial/bts/issue1144
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   135
echo "===== test that verify bundle does not traceback"
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   136
# partial history bundle, fails w/ unkown parent
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   137
hg -R bundle.hg verify
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   138
# full history bundle, refuses to verify non-local repo
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   139
hg -R all.hg verify
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   140
# but, regular verify must continue to work
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   141
hg -R orig verify
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   142
7853
af062a9fea9b bundlerepo: reintroduce dirstate
Matt Mackall <mpm@selenic.com>
parents: 7141
diff changeset
   143
echo "====== diff against bundle"
af062a9fea9b bundlerepo: reintroduce dirstate
Matt Mackall <mpm@selenic.com>
parents: 7141
diff changeset
   144
hg init b
af062a9fea9b bundlerepo: reintroduce dirstate
Matt Mackall <mpm@selenic.com>
parents: 7141
diff changeset
   145
cd b
af062a9fea9b bundlerepo: reintroduce dirstate
Matt Mackall <mpm@selenic.com>
parents: 7141
diff changeset
   146
hg -R ../all.hg diff -r tip
af062a9fea9b bundlerepo: reintroduce dirstate
Matt Mackall <mpm@selenic.com>
parents: 7141
diff changeset
   147
cd ..
7141
8d1bdaf842de issue 1144: prevent traceback on verify of bundles
John Mulligan <phlogistonjohn@asynchrono.us>
parents: 6316
diff changeset
   148
7853
af062a9fea9b bundlerepo: reintroduce dirstate
Matt Mackall <mpm@selenic.com>
parents: 7141
diff changeset
   149