~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to contrib/pwk

  • Committer: Martin Pool
  • Date: 2005-06-27 01:36:22 UTC
  • Revision ID: mbp@sourcefrog.net-20050627013622-0d56be3e3105043e
Merge from aaron:

------------------------------------------------------------
revno: 763
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 17:30:28 -0400
message:
  Copy files in immutable stores directly.
------------------------------------------------------------
revno: 762
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 16:12:33 -0400
message:
  Fixed direct call of get_url in RemoteBranch.get_revision
------------------------------------------------------------
revno: 761
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 12:00:31 -0400
message:
  Added prefetch support to update_revisions
------------------------------------------------------------
revno: 760
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 11:57:54 -0400
message:
  Added cache support to branch and pull
------------------------------------------------------------
revno: 759
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 11:21:37 -0400
message:
  Added find_cached_branch to branch
------------------------------------------------------------
revno: 758
committer: Aaron Bentley <abentley@panoramicfeedback.com>
timestamp: Thu 2005-06-23 11:17:10 -0400
message:
  Added CachedStore type to reduce remote downloads

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 show 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'