~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai/aba/commands/hard-undo

  • Committer: Aaron Bentley
  • Date: 2005-08-17 16:18:19 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050817161819-b2f1d02352df0dae
Shelve: Abstracted out filename selection and root-finding

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
 
   root=$(tla tree-root)
13
 
   if [ $? -ne 0 ]; then aba_panic "Can't find tree root!"; fi
14
 
   cd $root
15
 
   find -name '*.rej' -print0 |xargs -0r rm
16
 
   find -name '*.orig' -print0 |xargs -0r rm
17
 
   tla tree-lint -m|xargs -r rm
18
 
   tla undo $@
19
 
}
20
 
 
21
 
# one-liner description for aba help
22
 
cmd_desc()
23
 
{
24
 
    aba_desc $(basename $0) "Undo that almost always succeeds"
25
 
}
26
 
 
27
 
# short help for aba command -h, --help
28
 
cmd_help()
29
 
{
30
 
    cat <<EOH
31
 
Undo that almost always succeeds
32
 
usage: $abaname $(basename $0) [OPTIONS]
33
 
 
34
 
This undo will remove all .rej, .orig, and non-matching .id files before
35
 
undoing.  Its intended use is for undoing merges that produced too many
36
 
conflicts.
37
 
 
38
 
It takes the same parameters as 'undo'
39
 
EOH
40
 
}
41
 
 
42
 
# extended help for aba command -H or aba help command
43
 
cmd_ext_help()
44
 
{
45
 
    cat <<EOH
46
 
EOH
47
 
}       
48
 
 
49
 
aba_run "$@"
50
 
#  arch-tag: hardundo by Aaron Bentley  (10:42 May 12 2004)