1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
#!/bin/sh
HGENCODING=utf-8
export HGENCODING
try() {
echo '% hg debugrevspec' $@
hg debugrevspec --debug $@
}
log() {
echo "% log '$1'"
hg log --template '{rev}\n' -r "$1"
}
hg init repo
cd repo
echo a > a
hg branch a
hg ci -Aqm0
echo b > b
hg branch b
hg ci -Aqm1
rm a
hg branch a-b-c-
hg ci -Aqm2 -u Bob
hg co 1
hg branch +a+b+c+
hg ci -Aqm3
hg co 2 # interleave
echo bb > b
hg branch -- -a-b-c-
hg ci -Aqm4 -d "May 12 2005"
hg co 3
hg branch /a/b/c/
hg ci -Aqm"5 bug"
hg merge 4
hg branch _a_b_c_
hg ci -Aqm"6 issue619"
hg branch .a.b.c.
hg ci -Aqm7
hg branch all
hg ci --close-branch -Aqm8
hg co 4
hg branch é
hg ci -Aqm9
hg tag -r6 1.0
hg clone --quiet -U -r 7 . ../remote1
hg clone --quiet -U -r 8 . ../remote2
echo "[paths]" >> .hg/hgrc
echo "default = ../remote1" >> .hg/hgrc
# names that should work without quoting
try a
try b-a
try _a_b_c_
try _a_b_c_-a
try .a.b.c.
try .a.b.c.-a
try -- '-a-b-c-' # complains
log -a-b-c- # succeeds with fallback
try -- -a-b-c--a # complains
try é
# quoting needed
try '"-a-b-c-"-a'
log '1 or 2'
log '1|2'
log '1 and 2'
log '1&2'
try '1&2|3' # precedence - and is higher
try '1|2&3'
try '1&2&3' # associativity
try '1|(2|3)'
log '1.0' # tag
log 'a' # branch
log '2785f51ee'
log 'date(2005)'
log 'date(this is a test)'
log 'date()'
log 'date'
log 'date('
log 'date(tip)'
log '"date"'
log 'date(2005) and 1::'
log 'ancestor(1)'
log 'ancestor(4,5)'
log 'ancestor(4,5) and 4'
log 'ancestors(5)'
log 'author(bob)'
log 'branch(é)'
log 'children(ancestor(4,5))'
log 'closed()'
log 'contains(a)'
log 'descendants(2 or 3)'
log 'file(b)'
log 'follow()'
log 'grep("issue\d+")'
try 'grep("(")' # invalid regular expression
log 'head()'
log 'heads(6::)'
log 'keyword(issue)'
log 'limit(head(), 1)'
log 'max(contains(a))'
log 'merge()'
log 'modifies(b)'
log 'outgoing()'
log 'outgoing("../remote1")'
log 'outgoing("../remote2")'
log 'p1(merge())'
log 'p2(merge())'
log 'parents(merge())'
log 'removes(a)'
log 'roots(all())'
log 'reverse(2 or 3 or 4 or 5)'
log 'sort(limit(reverse(all()), 3))'
log 'sort(2 or 3 or 4 or 5, date)'
log 'tagged()'
log 'user(bob)'
log '4::8'
log '4:8'
log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
log 'not 0 and 0:2'
log 'not 1 and 0:2'
log 'not 2 and 0:2'
log '(1 and 2)::'
log '(1 and 2):'
log '(1 and 2):3'
log 'sort(head(), -rev)'
|