~abentley/bzrtools/bzrtools.dev

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
#! /bin/sh
## Copyright (C) 2004 Aaron Bentley
##
## See the file "COPYING" for further information about
## the copyright and warranty status of this work.

. "$abadir/aba-lib"

# executes the command ("$@" are the arguments after the command name)
cmd_exec()
{
  aba_tree_source;
  if [ $? -eq 2 ]; then
    echo "$(basename $0): not in project tree ($(pwd))"
  fi
  exit $?
}

# one-liner description for aba help
cmd_desc()
{
    aba_desc $(basename $0) "prints the name of the tag-source of the tree"
}

# short help for aba command -h, --help
cmd_help()
{
    cat <<EOH
Prints the name of the revision this tree was tagged from
usage: $abaname $(basename $0) 

This command uses data in the patch-logs, and outputs the full revision
name of the tag source revision.  If no tag source can be found, outputs
nothing, and exits with status 1.

It should be suitable for scripting, e.g. merges.

EOH
}

# extended help for aba command -H or aba help command
cmd_ext_help()
{
    cat <<EOH
If the patch logs have been mutilated, this command may return bad data.

EOH
}	

aba_run "$@"
# arch-tag: tree-source by Aaron Bentley  (11:33 Mar 09 2004)