/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to contrib/pwk

  • Committer: Martin Pool
  • Date: 2005-08-24 08:59:32 UTC
  • Revision ID: mbp@sourcefrog.net-20050824085932-c61f1f1f1c930e13
- Add a simple UIFactory 

  The idea of this is to let a client of bzrlib set some 
  policy about how output is displayed.

  In this revision all that's done is that progress bars
  are constructed by a policy established by the application
  rather than being randomly constructed in the library 
  or passed down the calls.  This avoids progress bars
  popping up while running the test suite and cleans up
  some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -pe
 
2
 
 
3
# take patches from patchwork into bzr
 
4
 
 
5
# authentication must be in ~/.netrc
 
6
 
 
7
# TODO: Scan all pending patches and say which ones apply cleanly.
 
8
 
 
9
# these should be moved into some kind of per-project configuration
 
10
PWK_ROOT='http://patchwork.ozlabs.org/bazaar-ng'
 
11
PWK_AUTH_ROOT='https://patchwork.ozlabs.org/bazaar-ng'
 
12
 
 
13
# bzr uses -p0 style; others use -p1
 
14
PATCH_OPTS='-p0'
 
15
 
 
16
usage() {
 
17
    cat <<EOF
 
18
usage: 
 
19
   pwk cat PATCH-ID       show the patch text
 
20
   pwk try PATCH-ID        see if the patch applies cleanly
 
21
   pwk apply PATCH-ID      apply patch into current directory
 
22
EOF
 
23
}
 
24
 
 
25
catpatch() {
 
26
    curl --silent --show-error --get -d id=$1 $PWK_ROOT/patchcontent
 
27
}
 
28
 
 
29
if [ $# -lt 1 ]
 
30
then
 
31
    usage
 
32
    exit 1
 
33
fi
 
34
 
 
35
 
 
36
case "$1" in
 
37
help|-h|--help)
 
38
    usage
 
39
    exit 0
 
40
    ;;
 
41
cat)
 
42
    catpatch $2 | ${PAGER:-less}
 
43
    ;;
 
44
try)
 
45
    catpatch $2 | patch -p0 --dry-run
 
46
    ;;
 
47
apply)
 
48
    catpatch $2 | patch -p0
 
49
    ;;
 
50
*)
 
51
    usage
 
52
    exit 1
 
53
esac
 
 
b'\\ No newline at end of file'