Patchwork [1/2] adapt patchwork-update-commits to pwclient changes

login
register
mail settings
Submitter Sascha Silbe
Date Feb. 11, 2011, 2:49 p.m.
Message ID <1297435761-5794-2-git-send-email-sascha-pgp@silbe.org>
Download mbox | patch
Permalink /patch/82888/
State Changes Requested
Headers show

Comments

Sascha Silbe - Feb. 11, 2011, 2:49 p.m.
pwclient requires the action (update) and the project name.

Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
---
 tools/patchwork-update-commits |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
Jeremy Kerr - Feb. 28, 2011, 1:37 a.m.
Hi Sascha,

> pwclient requires the action (update) and the project name.

It shouldn't *require* the project; that should be specified in .pwclientrc.

However, I'm assuming you'd like to override the project setting here - in 
that case, it'd be better to add an optional -p <project> argument to 
patchwork-update-commits, so we don't break existing usages of patchwork-
update-commits.

Cheers,


Jeremy

Patch

diff --git a/tools/patchwork-update-commits b/tools/patchwork-update-commits
index 245a66a..ce4f301 100755
--- a/tools/patchwork-update-commits
+++ b/tools/patchwork-update-commits
@@ -2,15 +2,18 @@ 
 
 pwpath=apps/patchwork
 
-if [ "$#" -lt 1 ]
+if [ "$#" -lt 2 ]
 then
-	echo "usage: $0 <revspec>" >&2
+	echo "usage: $0 <project> <revspec>" >&2
 	exit 1
 fi
 
+project="$1"
+shift
+
 git rev-list --reverse "$@" |
 while read commit
 do
 	hash=$(git show "$commit" | python $pwpath/parser.py -#)
-	$pwpath/bin/pwclient -s Accepted -c "$commit" -h "$hash"
+	$pwpath/bin/pwclient update -p "$project" -s Accepted -c "$commit" -h "$hash"
 done