tests/test-pull-branch
author Patrick Mezard <pmezard@gmail.com>
Mon, 15 Jun 2009 00:03:26 +0200
changeset 8810 ac92775b3b80
parent 7372 e17dbf140035
permissions -rwxr-xr-x
Add patch.eol to ignore EOLs when patching (issue1019) The intent is to fix many issues involving patching when win32ext is enabled. With win32ext, the working directory and repository files EOLs are not the same which means that patches made on a non-win32ext host do not apply cleanly because of EOLs discrepancies. A theorically correct approach would be transform either the patched file or the patch content with the encoding/decoding filters used by win32ext. This solution is tricky to implement and invasive, instead we prefer to address the win32ext case, by offering a way to ignore input EOLs when patching and rewriting them when saving the patched result.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7372
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     1
#!/bin/sh
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     2
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     3
hg init t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     4
cd t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     5
echo 1 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     6
hg ci -Am1 # 0
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     7
hg branch branchA
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     8
echo a1 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
     9
hg ci -ma1 # 1
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    10
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    11
cd ..
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    12
hg init tt
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    13
cd tt
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    14
hg pull ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    15
hg up branchA
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    16
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    17
cd ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    18
echo a2 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    19
hg ci -ma2 # 2
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    20
echo % create branch B
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    21
hg up 0
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    22
hg branch branchB
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    23
echo b1 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    24
hg ci -mb1 # 3
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    25
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    26
cd ../tt
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    27
echo % a new branch is there
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    28
hg pull -u ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    29
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    30
echo % develop both branch
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    31
cd ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    32
hg up branchA
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    33
echo a3 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    34
hg ci -ma3 # 4
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    35
hg up branchB
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    36
echo b2 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    37
hg ci -mb2 # 5
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    38
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    39
cd ../tt
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    40
echo % should succeed, no new heads
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    41
hg pull -u ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    42
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    43
echo % add an head on other branch
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    44
cd ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    45
hg up branchA
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    46
echo a4 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    47
hg ci -ma4 # 6
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    48
hg up branchB
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    49
echo b3.1 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    50
hg ci -m b3.1 # 7
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    51
hg up 5
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    52
echo b3.2 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    53
hg ci -m b3.2 # 8
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    54
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    55
cd ../tt
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    56
echo % should succeed only one head on our branch
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    57
hg pull -u ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    58
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    59
cd ../t
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    60
hg up -C branchA
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    61
echo a5.1 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    62
hg ci -ma5.1 # 9
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    63
hg up 6
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    64
echo a5.2 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    65
hg ci -ma5.2 # 10
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    66
hg up 7
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    67
echo b4.1 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    68
hg ci -m b4.1 # 11
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    69
hg up -C 8
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    70
echo b4.2 > foo
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    71
hg ci -m b4.2 # 12
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    72
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    73
cd ../tt
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    74
echo % should fail new head in our branch
e17dbf140035 pull: update to branch tip if there is only one head on the current branch
Benoit Allard <benoit@aeteurope.nl>
parents:
diff changeset
    75
hg pull -u ../t