tests/test-convert-hg-startrev
author Martin Geisler <mg@lazybytes.net>
Sun, 04 Oct 2009 22:03:41 +0200
changeset 10443 62d484a81dfe
parent 10119 bb5ea66789e3
permissions -rwxr-xr-x
minirst: support containers Text can be grouped into generic containers in reStructuredText: .. container:: foo This is text inside a "foo" container. .. container:: bar This is nested inside two containers. The minirst parser now recognizes these containers. The containers are either pruned completely from the output (included all nested blocks) or they are simply un-indented. So if 'foo' and 'bar' containers are kept, the above example will result in: This is text inside a "foo" container. This is nested inside two containers. If only 'foo' containers are kept, we get: This is text inside a "foo" container. No output is made if only 'bar' containers are kept. This feature will come in handy for implementing different levels of help output (e.g., verbose and debug level help texts).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6885
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
echo '[extensions]' >> $HGRCPATH
10119
bb5ea66789e3 tests: load with "ext =" instead of "hgext.ext ="
Martin Geisler <mg@lazybytes.net>
parents: 8523
diff changeset
     4
echo 'graphlog =' >> $HGRCPATH
bb5ea66789e3 tests: load with "ext =" instead of "hgext.ext ="
Martin Geisler <mg@lazybytes.net>
parents: 8523
diff changeset
     5
echo 'convert =' >> $HGRCPATH
6885
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
glog()
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
{
8523
5b7da468531b tests: replace #...# syntax with {...}
Martin Geisler <mg@lazybytes.net>
parents: 6885
diff changeset
     9
    hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
6885
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
}
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
hg init source
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
cd source
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
echo a > a
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
echo b > b
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
hg ci -d '0 0' -qAm '0: add a b'
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
echo c > c
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
hg ci -d '1 0' -qAm '1: add c'
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
hg copy a e
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
echo b >> b
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
hg ci -d '2 0' -qAm '2: copy e from a, change b'
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
hg up -C 0
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
echo a >> a
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
hg ci -d '3 0' -qAm '3: change a'
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
hg merge
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
hg copy b d
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
echo a >> a
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
hg ci -d '5 0' -qAm '5: change a'
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
cd ..
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
echo % convert from null revision
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
hg convert --config convert.hg.startrev=null source empty
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    35
glog empty
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
echo % convert from zero revision
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
hg convert --config convert.hg.startrev=0 source full
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
glog full
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
echo % convert from merge parent
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
hg convert --config convert.hg.startrev=1 source conv1
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
glog conv1
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
cd conv1
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
echo % check copy preservation
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
hg log --follow --copies e
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
echo % check copy removal on missing parent
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    48
hg log --follow --copies d
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    49
hg cat -r tip a b
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
hg -q verify
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    51
cd ..
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
echo % convert from merge
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    54
hg convert --config convert.hg.startrev=4 source conv4
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    55
glog conv4
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
cd conv4
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
hg up -C
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    58
hg cat -r tip a b
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    59
hg -q verify
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    60
cd ..
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    61