~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai/aba/commands/undelete

  • Committer: Robert Collins
  • Date: 2005-09-14 11:27:20 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-20050914112720-c66a21de86eafa6e
trim fai cribbage

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
 
. "$abadir/aba-lib"
8
 
 
9
 
# executes the command ("$@" are the arguments after the command name)
10
 
cmd_exec()
11
 
{
12
 
owd=$(tla tree-root)
13
 
if [ $? -ne 0 ]; then
14
 
  aba_panic "Not a project tree"
15
 
fi
16
 
revision=$(aba_tree_revision)
17
 
if [ $? -ne 0 ]; then
18
 
  aba_panic "Can't determine last revision"
19
 
fi
20
 
location=$(tla library-find $revision)
21
 
if [ $? -ne 0 ]; then
22
 
  if tla library-add $revision; then
23
 
    location=$(tla library-find $revision)
24
 
  else
25
 
    aba_panic "Can't find library revision for $revision"
26
 
  fi
27
 
fi
28
 
 
29
 
cd $location
30
 
for i in $(tla inventory -s); do
31
 
  if [ ! -f $owd/$i ]; then
32
 
    echo $i
33
 
    cp -p $i $owd/$i 
34
 
  fi 
35
 
done
36
 
}
37
 
 
38
 
# one-liner description for aba help
39
 
cmd_desc()
40
 
{
41
 
    aba_desc $(basename $0) "Restores deleted files"
42
 
}
43
 
 
44
 
# short help for aba command -h, --help
45
 
cmd_help()
46
 
{
47
 
    cat <<EOH
48
 
Restores deleted files
49
 
usage: $abaname $(basename $0)
50
 
 
51
 
Makes fresh copies of all files that have been deleted since the last commit.
52
 
All other files are ignored.
53
 
EOH
54
 
}
55
 
 
56
 
# extended help for aba command -H or aba help command
57
 
cmd_ext_help()
58
 
{
59
 
    cat <<EOH
60
 
EOH
61
 
}       
62
 
 
63
 
aba_run "$@"
64
 
#  arch-tag: undelete by Aaron Bentley  (09:55 Jun 18 2004)