tests/test-pull-branch
author Greg Ward <greg-hg@gerg.ca>
Mon, 05 Oct 2009 18:17:13 -0400
changeset 9547 f57640bf10d4
parent 7372 e17dbf140035
permissions -rwxr-xr-x
cmdutil: changeset_printer: use methods of filectx/changectx. This allows extensions that modify changeset metadata (e.g. description) by overriding methods of changectx to get consistent behavior from all log-like commands, regardless of whether templates or styles are used. Without this, overriding changectx methods works if you use styles or templates, but not with default log format. This meant adding filectx.extra() for consistency with changectx.
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