tests/test-convert-mtn
author Henrik Stuart <henrik.stuart@edlund.dk>
Sat, 23 May 2009 17:02:49 +0200
changeset 8562 e3495c399006
parent 8523 5b7da468531b
child 10119 bb5ea66789e3
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:
6372
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
"$TESTDIR/hghave" mtn || exit 80
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
# Monotone directory is called .monotone on *nix and monotone
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
# on Windows. Having a variable here ease test patching.
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
mtndir=.monotone
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
echo "[extensions]" >> $HGRCPATH
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
echo "convert=" >> $HGRCPATH
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
echo 'hgext.graphlog =' >> $HGRCPATH
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
HOME=`pwd`/do_not_use_HOME_mtn; export HOME
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
# Windows version of monotone home
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
APPDATA=$HOME; export APPDATA
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
echo % tedious monotone keys configuration
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
# The /dev/null redirection is necessary under Windows, or
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
# it complains about home directory permissions
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
passphrase
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
passphrase
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
EOF
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
cat >> $HOME/$mtndir/monotonerc <<EOF
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
function get_passphrase(keypair_id)
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
    return "passphrase"
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
end
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
EOF
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
echo % create monotone repository
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
mtn db init --db=repo.mtn
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
mtn --db=repo.mtn --branch=com.selenic.test setup workingdir
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
cd workingdir
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
echo a > a
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
mkdir dir
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    35
echo b > dir/b
8099
3cdf4872941a convert/mtn: handle new files in moved directories (issue1619)
Patrick Mezard <pmezard@gmail.com>
parents: 8050
diff changeset
    36
echo d > dir/d
6372
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
python -c 'file("bin", "wb").write("a\\x00b")'
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
echo c > c
8099
3cdf4872941a convert/mtn: handle new files in moved directories (issue1619)
Patrick Mezard <pmezard@gmail.com>
parents: 8050
diff changeset
    39
mtn add a dir/b dir/d c bin
6372
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
mtn ci -m initialize
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
echo % update monotone working directory
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
mtn mv a dir/a
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
echo a >> dir/a
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
echo b >> dir/b
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
mtn drop c
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
python -c 'file("bin", "wb").write("b\\x00c")'
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
mtn ci -m update1
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    48
cd ..
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    49
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
echo % convert once
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    51
hg convert -s mtn repo.mtn
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
cd workingdir
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    54
echo e > e
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    55
mtn add e
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
mtn drop dir/b
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
mtn mv bin bin2
6633
67a2d2d9bf21 test-convert-mtn: test descriptions with quotes
Patrick Mezard <pmezard@gmail.com>
parents: 6396
diff changeset
    58
mtn ci -m 'update2 "with" quotes'
8050
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    59
echo '% test directory move'
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    60
mkdir -p dir1/subdir1
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    61
mkdir -p dir1/subdir2_other
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    62
echo file1 > dir1/subdir1/file1
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    63
echo file2 > dir1/subdir2_other/file1
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    64
mtn add dir1/subdir1/file1 dir1/subdir2_other/file1
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    65
mtn ci -m createdir1
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    66
mtn rename dir1/subdir1 dir1/subdir2
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    67
mtn ci -m movedir1
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
    68
echo '% test subdirectory move'
6377
2cf67d007f41 test-convert-mtn: test directory move
Patrick Mezard <pmezard@gmail.com>
parents: 6376
diff changeset
    69
mtn mv dir dir2
8099
3cdf4872941a convert/mtn: handle new files in moved directories (issue1619)
Patrick Mezard <pmezard@gmail.com>
parents: 8050
diff changeset
    70
echo newfile > dir2/newfile
3cdf4872941a convert/mtn: handle new files in moved directories (issue1619)
Patrick Mezard <pmezard@gmail.com>
parents: 8050
diff changeset
    71
mtn drop dir2/d
3cdf4872941a convert/mtn: handle new files in moved directories (issue1619)
Patrick Mezard <pmezard@gmail.com>
parents: 8050
diff changeset
    72
mtn add dir2/newfile
6377
2cf67d007f41 test-convert-mtn: test directory move
Patrick Mezard <pmezard@gmail.com>
parents: 6376
diff changeset
    73
mtn ci -m movedir
6396
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    74
# Test directory removal with empty directory
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    75
mkdir dir2/dir
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    76
mkdir dir2/dir/subdir
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    77
echo f > dir2/dir/subdir/f
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    78
mkdir dir2/dir/emptydir
6873
39b4db2ea6ed Make test-convert-mtn pass on systems where mtn add -R uses different order
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6633
diff changeset
    79
mtn add --quiet -R dir2/dir
6396
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    80
mtn ci -m emptydir
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    81
mtn drop -R dir2/dir
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
    82
mtn ci -m dropdirectory
8123
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    83
echo '% test directory and file move'
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    84
mkdir -p dir3/d1
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    85
echo a > dir3/a
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    86
mtn add dir3/a dir3/d1
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    87
mtn ci -m dirfilemove
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    88
mtn mv dir3/a dir3/d1/a
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    89
mtn mv dir3/d1 dir3/d2
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
    90
mtn ci -m dirfilemove2
8124
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    91
echo '% test directory move into another directory move'
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    92
mkdir dir4
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    93
mkdir dir5
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    94
echo a > dir4/a
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    95
mtn add dir4/a dir5
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    96
mtn ci -m dirdirmove
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    97
mtn mv dir5 dir6
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    98
mtn mv dir4 dir6/dir4
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
    99
mtn ci -m dirdirmove2
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   100
echo '% test diverging directory moves'
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   101
mkdir -p dir7/dir9/dir8
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   102
echo a > dir7/dir9/dir8/a
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   103
echo b > dir7/dir9/b
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   104
echo c > dir7/c
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   105
mtn add -R dir7
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   106
mtn ci -m divergentdirmove
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   107
mtn mv dir7 dir7-2
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   108
mtn mv dir7-2/dir9 dir9-2
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   109
mtn mv dir9-2/dir8 dir8-2
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   110
mtn ci -m divergentdirmove2
6372
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   111
cd ..
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   112
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   113
echo % convert incrementally
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   114
hg convert -s mtn repo.mtn
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   115
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   116
glog()
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   117
{
8523
5b7da468531b tests: replace #...# syntax with {...}
Martin Geisler <mg@lazybytes.net>
parents: 8124
diff changeset
   118
    hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
6372
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   119
}
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   120
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   121
cd repo.mtn-hg
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   122
hg up -C
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   123
glog
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   124
echo % manifest
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   125
hg manifest
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   126
echo % contents
6377
2cf67d007f41 test-convert-mtn: test directory move
Patrick Mezard <pmezard@gmail.com>
parents: 6376
diff changeset
   127
cat dir2/a
6396
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
   128
test -d dir2/dir && echo 'removed dir2/dir is still there!'
8050
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   129
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   130
echo % file move
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   131
hg log -v -C -r 1 | grep copies
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   132
echo % check directory move
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   133
hg manifest -r 4
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   134
test -d dir1/subdir2 || echo 'new dir1/subdir2 does not exist!'
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   135
test -d dir1/subdir1 && echo 'renamed dir1/subdir1 is still there!'
087cc65bebff convert/mtn: record changes from directory renames (issue1587)
Patrick Mezard <pmezard@gmail.com>
parents: 6873
diff changeset
   136
hg log -v -C -r 4 | grep copies
8099
3cdf4872941a convert/mtn: handle new files in moved directories (issue1619)
Patrick Mezard <pmezard@gmail.com>
parents: 8050
diff changeset
   137
echo % check file remove with directory move
3cdf4872941a convert/mtn: handle new files in moved directories (issue1619)
Patrick Mezard <pmezard@gmail.com>
parents: 8050
diff changeset
   138
hg manifest -r 5
8123
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
   139
echo % check file move with directory move
933b874e402f convert/mtn: handle files moved in a moved directory (issue1619/2)
Patrick Mezard <pmezard@gmail.com>
parents: 8099
diff changeset
   140
hg manifest -r 9
8124
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   141
echo % check file directory directory move
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   142
hg manifest -r 11
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   143
echo % check divergent directory moves
d883bfbd2e60 convert/mtn: handle directory move into moved directory (issue1619/3)
Patrick Mezard <pmezard@gmail.com>
parents: 8123
diff changeset
   144
hg manifest -r 13
6396
18eeabae6148 test-convert-mtn: test directory deletion
Patrick Mezard <pmezard@gmail.com>
parents: 6377
diff changeset
   145
exit 0
6372
8f79820443a4 Add a test for monotone conversion
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   146