/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: Robert Collins
  • Date: 2010-05-04 06:22:51 UTC
  • mto: This revision was merged to the branch mainline in revision 5206.
  • Revision ID: robertc@robertcollins.net-20100504062251-1ocjhrl53mum9ehw
Minor local_abspath docstring improvement.

Show diffs side-by-side

added added

removed removed

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