~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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /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_no_changes
  partnerfile=`tla tree-root 2> /dev/null`/{arch}/=partner-versions 
  if [ -n "$1" ]; then
    versions="$1";
  elif [ -f $partnerfile ]; then
    versions=$(cat $partnerfile)
  else
    versions=$(tla parse-package-name --package-version $(aba_tree_source))
  fi

  microbranch=$(tla tree-version)
  for version in $versions; do
    echo "* replaying missing revisions from $version"
    for rev in $(tla missing -f $version); do
      if tla cat-archive-log $rev | grep "Microbranch: $microbranch" > /dev/null; then
	if ! tla replay $rev; then
	  return 1
	fi
      fi
    done
  done
}

# one-liner description for aba help
cmd_desc()
{
    aba_desc $(basename $0) "Replays revisions for a microbranch"
}

# short help for aba command -h, --help
cmd_help()
{
    cat <<EOH
Replays revisions for a microbranch
usage: $abaname $(basename $0) [VERSION]

Applies all missing revisions from SOURCE-VERSIONS whose Microbranch headers
match the tree-revision.

The following are candidates for SOURCE-VERSIONS:
1. the specified VERSION, if any
2. the versions specified in {arch]/=partner-versions if it exists
3. the tree tag-source, if any
EOH
}

# extended help for aba command -H or aba help command
cmd_ext_help()
{
    cat <<EOH

replay-micro will abort if applying a changeset produces conflicts.  It will
refuse to start if the project tree already contains changes.
EOH
}	

aba_run "$@"
#  arch-tag: replay-micro by Aaron Bentley  (18:16 May 27 2004)