~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai/aba/commands/replay-micro

  • 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
. "$abadir/aba-lib"
 
8
 
 
9
# executes the command ("$@" are the arguments after the command name)
 
10
cmd_exec()
 
11
{
 
12
  aba_no_changes
 
13
  partnerfile=`tla tree-root 2> /dev/null`/{arch}/=partner-versions 
 
14
  if [ -n "$1" ]; then
 
15
    versions="$1";
 
16
  elif [ -f $partnerfile ]; then
 
17
    versions=$(cat $partnerfile)
 
18
  else
 
19
    versions=$(tla parse-package-name --package-version $(aba_tree_source))
 
20
  fi
 
21
 
 
22
  microbranch=$(tla tree-version)
 
23
  for version in $versions; do
 
24
    echo "* replaying missing revisions from $version"
 
25
    for rev in $(tla missing -f $version); do
 
26
      if tla cat-archive-log $rev | grep "Microbranch: $microbranch" > /dev/null; then
 
27
        if ! tla replay $rev; then
 
28
          return 1
 
29
        fi
 
30
      fi
 
31
    done
 
32
  done
 
33
}
 
34
 
 
35
# one-liner description for aba help
 
36
cmd_desc()
 
37
{
 
38
    aba_desc $(basename $0) "Replays revisions for a microbranch"
 
39
}
 
40
 
 
41
# short help for aba command -h, --help
 
42
cmd_help()
 
43
{
 
44
    cat <<EOH
 
45
Replays revisions for a microbranch
 
46
usage: $abaname $(basename $0) [VERSION]
 
47
 
 
48
Applies all missing revisions from SOURCE-VERSIONS whose Microbranch headers
 
49
match the tree-revision.
 
50
 
 
51
The following are candidates for SOURCE-VERSIONS:
 
52
1. the specified VERSION, if any
 
53
2. the versions specified in {arch]/=partner-versions if it exists
 
54
3. the tree tag-source, if any
 
55
EOH
 
56
}
 
57
 
 
58
# extended help for aba command -H or aba help command
 
59
cmd_ext_help()
 
60
{
 
61
    cat <<EOH
 
62
 
 
63
replay-micro will abort if applying a changeset produces conflicts.  It will
 
64
refuse to start if the project tree already contains changes.
 
65
EOH
 
66
}       
 
67
 
 
68
aba_run "$@"
 
69
#  arch-tag: replay-micro by Aaron Bentley  (18:16 May 27 2004)