tests/test-newbranch
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Thu, 21 Feb 2008 16:22:31 -0300
changeset 6158 23ffe82615d8
parent 5988 ee317dbfb9d0
child 6160 3ee3bc5d06c5
permissions -rwxr-xr-x
repo.status: also compare flags for files in the lookup list. We might be able to do something smarter about this in dirstate.status for files in normallookup state, but that would require some extra care to keep backwards compatibility.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     1
#!/bin/sh
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     2
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     3
hg init t
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     4
cd t
3502
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
     5
hg branches
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     6
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     7
echo foo > a
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     8
hg add a
3760
aeafd80c1e78 small fixes for test-newbranch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3502
diff changeset
     9
hg ci -m "initial" -d "1000000 0"
3502
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    10
hg branch foo
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    11
hg branch
3760
aeafd80c1e78 small fixes for test-newbranch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3502
diff changeset
    12
hg ci -m "add branch name" -d "1000000 0"
3502
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    13
hg branch bar
3760
aeafd80c1e78 small fixes for test-newbranch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3502
diff changeset
    14
hg ci -m "change branch name" -d "1000000 0"
4203
aee3d312c32e Add test for branch shadowing
Brendan Cully <brendan@kublai.com>
parents: 4175
diff changeset
    15
echo % branch shadowing
4179
7e1c8a565a4f Move branch read/write to dirstate where it belongs
Matt Mackall <mpm@selenic.com>
parents: 4177
diff changeset
    16
hg branch default
4209
dbc3846c09a1 Merge with -stable, fix small test failure
Matt Mackall <mpm@selenic.com>
parents: 4203 4179
diff changeset
    17
hg branch -f default
3760
aeafd80c1e78 small fixes for test-newbranch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3502
diff changeset
    18
hg ci -m "clear branch name" -d "1000000 0"
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    19
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    20
hg co foo
3502
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    21
hg branch
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    22
echo bleah > a
3760
aeafd80c1e78 small fixes for test-newbranch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3502
diff changeset
    23
hg ci -m "modify a branch" -d "1000000 0"
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    24
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    25
hg merge
3502
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    26
hg branch
3760
aeafd80c1e78 small fixes for test-newbranch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3502
diff changeset
    27
hg ci -m "merge" -d "1000000 0"
3420
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    28
hg log
2576b6731524 Add some basic branch name tests
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    29
3502
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    30
hg branches
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    31
hg branches -q
8dc14d630b29 add branch and branches commands
Matt Mackall <mpm@selenic.com>
parents: 3451
diff changeset
    32
3451
196baf20232b Add test for invalid branch cache (fixed by 27ebe4efe98e)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3420
diff changeset
    33
echo % test for invalid branch cache
196baf20232b Add test for invalid branch cache (fixed by 27ebe4efe98e)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3420
diff changeset
    34
hg rollback
4177
a7af0eeae8a3 Move branches.cache to branch.cache
Matt Mackall <mpm@selenic.com>
parents: 4175
diff changeset
    35
cp .hg/branch.cache .hg/bc-invalid
3760
aeafd80c1e78 small fixes for test-newbranch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3502
diff changeset
    36
hg log -r foo
4177
a7af0eeae8a3 Move branches.cache to branch.cache
Matt Mackall <mpm@selenic.com>
parents: 4175
diff changeset
    37
cp .hg/bc-invalid .hg/branch.cache
3761
9433bdcaa9ae Ignore all errors while parsing the branch cache.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3760
diff changeset
    38
hg --debug log -r foo
4177
a7af0eeae8a3 Move branches.cache to branch.cache
Matt Mackall <mpm@selenic.com>
parents: 4175
diff changeset
    39
rm .hg/branch.cache
a7af0eeae8a3 Move branches.cache to branch.cache
Matt Mackall <mpm@selenic.com>
parents: 4175
diff changeset
    40
echo corrupted > .hg/branch.cache
3761
9433bdcaa9ae Ignore all errors while parsing the branch cache.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3760
diff changeset
    41
hg log -qr foo
4177
a7af0eeae8a3 Move branches.cache to branch.cache
Matt Mackall <mpm@selenic.com>
parents: 4175
diff changeset
    42
cat .hg/branch.cache
4175
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    43
5988
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    44
echo % push should update the branch cache
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    45
hg init ../target
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    46
echo % pushing just rev 0
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    47
hg push -qr 0 ../target
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    48
cat ../target/.hg/branch.cache
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    49
echo % pushing everything
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    50
hg push -qf ../target
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    51
cat ../target/.hg/branch.cache
ee317dbfb9d0 update the branch cache at the end of addchangegroup
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4410
diff changeset
    52
4175
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    53
echo % update with no arguments: tipmost revision of the current branch
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    54
hg up -q -C 0
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    55
hg up -q
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    56
hg id
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    57
hg up -q 1
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    58
hg up -q
fc12ac3755d5 Test update to branch tip
Brendan Cully <brendan@kublai.com>
parents: 4169
diff changeset
    59
hg id
4231
83153299aab5 avoid a traceback with hg branch newbranch; hg up
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4179
diff changeset
    60
hg branch foobar
83153299aab5 avoid a traceback with hg branch newbranch; hg up
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4179
diff changeset
    61
hg up
83153299aab5 avoid a traceback with hg branch newbranch; hg up
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4179
diff changeset
    62
4410
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    63
echo % fastforward merge
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    64
hg branch ff
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    65
echo ff > ff
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    66
hg ci -Am'fast forward' -d '1000000 0'
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    67
hg up foo
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    68
hg merge ff
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    69
hg branch
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    70
hg commit -m'Merge ff into foo' -d '1000000 0'
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    71
hg parents
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    72
hg manifest
bbc97d419b16 Add fast-forward branch merging
Brendan Cully <brendan@kublai.com>
parents: 4232
diff changeset
    73
4231
83153299aab5 avoid a traceback with hg branch newbranch; hg up
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4179
diff changeset
    74
exit 0