File: 022_update_details

package info (click to toggle)
fsvs 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,964 kB
  • ctags: 1,464
  • sloc: ansic: 16,650; sh: 5,885; perl: 783; makefile: 338; python: 90
file content (74 lines) | stat: -rwxr-xr-x 1,422 bytes parent folder | download | duplicates (4)
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
#!/bin/bash
# Test whether "fsvs up" hides previously new files.

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

filename=new-file-XYZ
dir=new-dir-ABC
file2=$dir/EFGH

logfile=$LOGDIR/022.logfile


# We don't use backticks here - in case there's an error in fsvs, the shell
# would not stop.
$BINq up > $logfile
# this next line has two tabulators - in grep and cut
rev=`grep "revision	" $logfile | tail -1 | cut -f2 -d"	" | cut -f1 -d"."` 
echo "now at rev. $rev"

touch empty-file
$BINq ci -m "new file"
# Goto old revision
$BINq up -r$rev -o delay=yes


# Modify WC
mkdir $dir
echo A > $filename
echo B > $file2

# Save current state
$BINdflt st | grep new > $logfile

# Goto last revision
$BINq up

# The status must not have changed!
if $BINdflt st | grep new | cmp $logfile -
then
  $SUCCESS "update keeps new files, status shows them"
else
	$ERROR_NB "old was:"
	cat $logfile
	$ERROR_NB "new is:"
	$BINdflt st
  $ERROR "update hides new files"
fi

# Now commit, so that the new files are versioned
$BINq ci -m "new"


# now set a fixed target revision
$INFO	"Testing fixed target revision $rev"
$BINq urls target:$rev,$REPURL
$BINq up
( cd $WC2 ; $BINq up -r$rev )
$COMPAREWITH $WC2

# But command-line has still precedence
$BINq up -rHEAD
( cd $WC2 ; $BINq up )
$COMPAREWITH $WC2

# Return to old revision
$BINq up
( cd $WC2 ; $BINq up -r$rev )
$COMPAREWITH $WC2


$SUCCESS "Update-behaviour passed."