File: 003_change_type

package info (click to toggle)
fsvs 1.1.16-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,344 kB
  • ctags: 1,133
  • sloc: ansic: 14,472; sh: 6,793; perl: 631; makefile: 337
file content (92 lines) | stat: -rwxr-xr-x 1,665 bytes parent folder | download
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
#!/bin/bash

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

logfile=$LOGDIR/003.change_types

if [[ $UID -eq 0 ]]
then
	ONLY_ROOT=
else
	ONLY_ROOT=ignore_func
	function ignore_func()
	{
	  true
	}
fi

if test -d typechange
then
  rm -r typechange
fi

mkdir typechange
 pushd typechange > /dev/null

 for i in file device symlink dir
 do
	 echo file > file-$i
	 $ONLY_ROOT cp -a /dev/zero device-$i
	 ln -s file-$i symlink-$i
	 mkdir dir-$i
	 echo sub > dir-$i/sub-entry
	 mkdir dir-$i/sub
	 touch dir-$i/sub/sub-entry
 done
popd > /dev/null


$BINq ci -m "inserted types" -o delay=yes > $logfile
rev=`grep "revision	" $logfile | tail -1 | cut -f2 -d"	" | cut -f1 -d" "` 
$INFO "initial checkin is r$rev"

# now goto other wc and update
pushd $WC2 > /dev/null
$BINq up

$BINdflt st > $logfile

$COMPARE_1_2
popd > /dev/null

rm -r typechange/*
pushd typechange > /dev/null

 for i in file device symlink dir
 do
	 echo file > $i-file
	 $ONLY_ROOT cp -a /dev/zero $i-device
	 ln -s $i-1 $i-symlink
	 mkdir $i-dir
	 echo sub > $i-dir/sub-entry
	 mkdir $i-dir/sub
	 touch $i-dir/sub/sub-entry
 done
popd > /dev/null

$BINq ci -m "changed types" -o delay=yes > $logfile
if [[ `$BINdflt st -C -C | wc -l` -ne 0 ]]
then
	$BINdflt st -C -C
	$ERROR "Entries left out of commit"
fi
$INFO "typechange done, running update"

$BINdflt up $WC2 > $logfile
$INFO "update done"

$WC2_UP_ST_COMPARE
$SUCCESS "all types changed to other types."
exit

export FSVS_WARNING="mixed-rev-wc=ignore"

# Now we change WC1 back via update, and revert everything in WC2.
$BINq up -r$rev $WC2
$BINq revert -r$rev -R -R .

$COMPARE_1_2
$SUCCESS "Revert works across type-changes too."