~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai/aba/commands/viewdiff

  • Committer: Robert Collins
  • Date: 2005-09-13 10:46:27 UTC
  • mto: (147.2.6) (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: robertc@robertcollins.net-20050913104627-51f938950a907475
handle inaccessible sibling archives somewhat - note version-0 is still not handled

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
## Copyright (C) 2004 Aaron Bentley
 
3
##
 
4
## See the file "COPYING" for further information about
 
5
## the copyright and warranty status of this work.
 
6
 
 
7
#prevent infinite filter loops!
 
8
unset ABAFILTER
 
9
export ABAFILTER
 
10
 
 
11
. "$abadir/aba-lib"
 
12
 
 
13
# executes the command ("$@" are the arguments after the command name)
 
14
cmd_exec()
 
15
{
 
16
  if aba_supports_option file-find silent; then
 
17
    silent="--silent"
 
18
  fi
 
19
  if [ -z "$VIEWDIFF" ]; then
 
20
    echo '$VIEWDIFF is unset' >&2
 
21
    exit 1
 
22
  fi
 
23
  loc=$(tla file-find $silent $1 $2)
 
24
  if [ -z "$loc" ]; then
 
25
    echo "Cannot find library revision for $1"
 
26
    exit 1
 
27
  fi
 
28
  $VIEWDIFF $loc $1
 
29
}
 
30
 
 
31
# one-liner description for aba help
 
32
cmd_desc()
 
33
{
 
34
    aba_desc $(basename $0) "Uses \$VIEWDIFF to compare file revisions"
 
35
}
 
36
 
 
37
# short help for aba command -h, --help
 
38
cmd_help()
 
39
{
 
40
    cat <<EOH
 
41
Uses \$VIEWDIFF to compare file revisions
 
42
usage: $abaname $(basename $0) file [revision]
 
43
 
 
44
Uses \$VIEWDIFF to compare two file revisions.
 
45
EOH
 
46
}
 
47
 
 
48
# extended help for aba command -H or aba help command
 
49
cmd_ext_help()
 
50
{
 
51
    cat <<EOH
 
52
EOH
 
53
}       
 
54
 
 
55
aba_run "$@"
 
56
#  arch-tag: vimdiff by Aaron Bentley  (16:41 Apr 30 2004)