| 1 |
# t630 --- co -S -l |
| 2 |
# |
| 3 |
# Copyright (C) 2011-2022 Thien-Thi Nguyen |
| 4 |
# |
| 5 |
# This program is free software: you can redistribute it and/or |
| 6 |
# modify it under the terms of the GNU General Public License as |
| 7 |
# published by the Free Software Foundation, either version 3 of |
| 8 |
# the License, or (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty |
| 12 |
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
# See the GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
. $srcdir/common |
| 19 |
co --help >/dev/null 2>&1 || exit 77 |
| 20 |
co --help | grep -F -e ' -S' >/dev/null || exit 77 |
| 21 |
split_std_out_err no |
| 22 |
|
| 23 |
## |
| 24 |
# Check that "co -S -l" DTRT. |
| 25 |
## |
| 26 |
|
| 27 |
lcount () |
| 28 |
{ |
| 29 |
rlog $v | sed '/^locks/,/^access/!d' | tee $wd/extract | wc -l |
| 30 |
} |
| 31 |
|
| 32 |
$hey set -x |
| 33 |
|
| 34 |
cp `bundled_commav two` $v |
| 35 |
|
| 36 |
## |
| 37 |
# * HEAD |
| 38 |
## |
| 39 |
co -l -f $w || problem 'co -l #1' |
| 40 |
co -l -f $w || problem 'co -l #2' |
| 41 |
co -S -l -f $w && problem 'co -S did not fail' |
| 42 |
test 3 = `lcount` || problem 'unexpected number of locks' |
| 43 |
|
| 44 |
## |
| 45 |
# * non-HEAD does not interfere w/ current lock |
| 46 |
## |
| 47 |
co -S -l4.20 -f $w || problem 'co -S on non-HEAD failed' |
| 48 |
test 4 = `lcount` || problem 'unexpected number of locks' |
| 49 |
|
| 50 |
exit 0 |
| 51 |
|
| 52 |
# t630 ends here |