File: cvs-xdiff

package info (click to toggle)
xxdiff 1%3A4.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,716 kB
  • ctags: 2,245
  • sloc: cpp: 18,495; python: 6,134; sh: 1,543; ansic: 1,535; perl: 308; lex: 284; yacc: 279; lisp: 250; tcl: 213; makefile: 82
file content (66 lines) | stat: -rw-r--r-- 1,396 bytes parent folder | download | duplicates (10)
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
#!/bin/sh
#
# $Source$
# $Id: cvs-xdiff 101 2001-04-02 16:21:21Z blais $
#

#
# validate parameters
#

# get module name
#module=`basename $PWD`
module=`cat CVS/Repository`
echo In Module "$module":

# get filename
filename=$1
if [ -z "$filename" ] ; then
   echo "Usage: xdiffcvs <filename> [<revleft> [<revright>]]" 
   exit 1 
fi

# get revision numbers, if present
revleft=$2
revright=$3


#
# create the two temporary files
#
current=$PWD

# create left file
cvs co -p$revleft $module/$filename,v > /tmp/xdiffcvs-left.tmp

# create the right file
if [ -z "$revright" ] ; then
   cp $filename /tmp/xdiffcvs-right.tmp
   chmod 700 /tmp/xdiffcvs-right.tmp
else
   cvs co -p$revright $module/$filename,v > /tmp/xdiffcvs-right.tmp
fi

# echo message
echo ===============================================================================
if [ -z "$revleft" ] ; then
   echo Left: $filename -- Latest \|\| Right: $filename -- Local
elif [ -z "$revright" ] ; then
   echo Left: $filename -- Rev $revleft \|\| Right: $filename -- Local
else
   echo Left: $filename -- Rev $revleft \|\| Right: $filename -- $revright
fi
echo ===============================================================================

#
# spawn xdiff on them
#
xdiff /tmp/xdiffcvs-left.tmp /tmp/xdiffcvs-right.tmp &

#
# cleanup
#
sleep 5 # give xdiff time to load the files...
rm /tmp/xdiffcvs-left.tmp
rm /tmp/xdiffcvs-right.tmp