tests/test-bookmarks
author Patrick Mezard <pmezard@gmail.com>
Sun, 04 Oct 2009 22:23:11 +0200
changeset 9526 457a30ed8ffb
parent 7261 4ba89b6d0e05
child 10826 717c35d55fb3
permissions -rwxr-xr-x
convert/darcs: fix file renaming (issue1853)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     1
#!/bin/sh
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     2
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     3
echo "[extensions]" >> $HGRCPATH
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     4
echo "bookmarks=" >> $HGRCPATH
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     5
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     6
hg init
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     7
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     8
echo % no bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
     9
hg bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    10
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    11
echo % bookmark rev -1
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    12
hg bookmark X
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    13
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    14
echo % list bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    15
hg bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    16
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    17
echo a > a
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    18
hg add a
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    19
hg commit -m 0
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    20
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    21
echo % bookmark X moved to rev 0
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    22
hg bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    23
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    24
echo % look up bookmark
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    25
hg log -r X
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    26
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    27
echo % second bookmark for rev 0
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    28
hg bookmark X2
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    29
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    30
echo % bookmark rev -1 again
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    31
hg bookmark -r null Y
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    32
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    33
echo % list bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    34
hg bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    35
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    36
echo b > b
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    37
hg add b
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    38
hg commit -m 1
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    39
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    40
echo % bookmarks X and X2 moved to rev 1, Y at rev -1
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    41
hg bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    42
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    43
echo % bookmark rev 0 again
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    44
hg bookmark -r 0 Z
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    45
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    46
echo c > c
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    47
hg add c
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    48
hg commit -m 2
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    49
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    50
echo % bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    51
hg bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    52
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    53
echo % rename nonexistent bookmark
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    54
hg bookmark -m A B
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    55
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    56
echo % rename to existent bookmark
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    57
hg bookmark -m X Y
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    58
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    59
echo % force rename to existent bookmark
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    60
hg bookmark -f -m X Y
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    61
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    62
echo % list bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    63
hg bookmark
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    64
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    65
echo % rename without new name
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    66
hg bookmark -m Y
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    67
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    68
echo % delete without name
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    69
hg bookmark -d
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    70
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    71
echo % delete nonexistent bookmark
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    72
hg bookmark -d A
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    73
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    74
echo % bookmark name with spaces should be stripped
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    75
hg bookmark ' x  y '
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    76
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    77
echo % list bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    78
hg bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    79
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    80
echo % look up stripped bookmark name
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    81
hg log -r 'x  y'
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    82
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    83
echo % reject bookmark name with newline
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    84
hg bookmark '
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    85
'
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    86
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    87
echo % bookmark with existing name
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    88
hg bookmark Z
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    89
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    90
echo % force bookmark with existing name
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    91
hg bookmark -f Z
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    92
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    93
echo % list bookmarks
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    94
hg bookmark
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    95
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    96
echo % revision but no bookmark name
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    97
hg bookmark -r .
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    98
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    99
true