File: 042_checkout

package info (click to toggle)
fsvs 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,964 kB
  • ctags: 1,464
  • sloc: ansic: 16,650; sh: 5,885; perl: 783; makefile: 338; python: 90
file content (69 lines) | stat: -rwxr-xr-x 1,669 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

set -e 
$PREPARE_DEFAULT > /dev/null
$INCLUDE_FUNCS

logfile=$LOGDIR/042.log

# export to new directory
CODIR=$WC2/checkout
if [[ -e $CODIR ]]
then
  rm -r $CODIR
fi

dir_norm=`$PATH2SPOOL $CODIR dir "" $CODIR`
dir_sr=`$PATH2SPOOL $CODIR dir $WC2 $CODIR`
echo Got filenames:
echo "   normal   "$dir_norm
echo "   softroot "$dir_sr
rm $dir_norm $dir_sr 2> /dev/null || true

mkdir $CODIR
$BINdflt checkout $REPURL $CODIR > $logfile
$COMPAREWITH $CODIR

rm -rf $CODIR
mkdir $CODIR
$BINq checkout -r 3 $REPURL $CODIR > $logfile
$BINq up -r 3 $WC
$COMPAREWITH $CODIR

if [[ -e $dir_norm && ! -e $dir_sr ]]
then
  $SUCCESS "Checkout makes the correct dir file (1)"
else
  $ERROR "Checkout doesn't create the dir listings (1)"
fi

# Test softroot
rm -rf $CODIR
mkdir -p $CODIR $WC2/$FSVS_CONF $WC2/$FSVS_WAA
rm $WC2/$dir_norm $WC2/$dir_sr $dir_norm $dir_sr 2>/dev/null || true
# Test normalization too - make extra slashes
$BINq checkout -o softroot=//$WC2/././ $REPURL //$CODIR// > $logfile
$BINq up $WC
$COMPAREWITH $CODIR

if [[ ! -e $WC2/$dir_norm && -e $WC2/$dir_sr &&
			! -e $dir_norm && ! -e $dir_sr ]]
then
  $SUCCESS "Checkout makes the correct dir files (2)"
else
	LC_ALL=C ls -la $WC2/$dir_norm $WC2/$dir_sr $dir_norm $dir_sr 2>&1 | perl -pe 'sub BEGIN { $x=shift() } s#$x/##;' $TESTBASE || true
  $ERROR "Checkout doesn't create the correct dir listings (2)"
fi


# Lets see if a later update works
$BINq update -r 3 -o softroot=/./$WC2/.// /./$CODIR// 
$BINq update -r HEAD -o softroot=/././$WC2/././ /./$CODIR// 
$COMPAREWITH $CODIR

# Try a commit
touch $CODIR/softroot
$BINq commit -o softroot=$WC2 $CODIR -m 1
$BINq up $WC
$COMPAREWITH $CODIR