diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2014-07-01 20:14:24 +0200 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-07-04 08:37:46 +0800 |
commit | 429ef9ba9dcc8f92b8362c1b0fca0916db05e84b (patch) | |
tree | 8ee6eaa242961eb87b6375b0f24fbc99084802c9 /templates | |
parent | ce4e9c7096be1222592700cdad84cf35895159da (diff) | |
download | patchwork-429ef9ba9dcc8f92b8362c1b0fca0916db05e84b.tar patchwork-429ef9ba9dcc8f92b8362c1b0fca0916db05e84b.tar.gz |
pwclient: accept more than one project in ~/.pwclientrc
Currently, given the format of ~/.pwclientrc, pwclient can only
really act on a single project, as ~/pwclientrc can only contain
the configuration for a single project.
Although the -p options comes in handy to specify a project
different from the one configured in ~/.pwclientrc, this only works
if it is hosted on the same server. As soon as one needs to switch
server, it is necessary to edit ~/pwclientrc.
This can be quite inefficient when dealing with many projects, hosted
on different servers.
Change the format of ~/.pwclientrc so it is possible to define more
than one project, and for each project, specify an URL and credentials.
The new format is like:
[options]
default = project-A
[project-A]
url = http://my.patchwork.server/path/to/xmlrpc
username = that-is-me
password = secret
[other-project]
url = http://you.get/the/idea
username = someone
password = 1234
This has the advantage of not changing the options to pwclient, so
the user experience is unmodified.
If a ~/.pwclentrc exists in the old format, it is automatically
converted over to the new format, and the previous one is saved as
~/.pwclientrc.orig. Upon conversion, no action is made, pwclient just
exits (with return-code 1) to inform the user to review the conversion.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/patchwork/pwclientrc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/patchwork/pwclientrc b/templates/patchwork/pwclientrc index 436a28b..d331003 100644 --- a/templates/patchwork/pwclientrc +++ b/templates/patchwork/pwclientrc @@ -1,15 +1,15 @@ # Sample .pwclientrc file for the {{ project.linkname }} project, # running on {{ site.domain }}. # -# Save this file to ~/.pwclientrc -# -[base] -url: {{scheme}}://{{site.domain}}{% url 'patchwork.views.xmlrpc.xmlrpc' %} -project: {{ project.linkname }} +# Just append this file to your existing ~/.pwclientrc +# If you do not already have a ~/.pwclientrc, then copy this file to +# ~/.pwclientrc, and uncomment the following two lines: +# [options] +# default={{ project.linkname }} + +[{{ project.linkname }}] +url= {{scheme}}://{{site.domain}}{% url 'patchwork.views.xmlrpc.xmlrpc' %} {% if user.is_authenticated %} -# Adding authentication parameters will allow you to use the 'update' -# command on patches that you are allowed to edit. -[auth] username: {{ user.username }} password: <add your patchwork password here> {% endif %} |