]> git.ozlabs.org Git - patchwork/commit
pwclient: accept more than one project in ~/.pwclientrc
authorYann E. MORIN <yann.morin.1998@free.fr>
Tue, 1 Jul 2014 18:14:24 +0000 (20:14 +0200)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 4 Jul 2014 00:37:46 +0000 (08:37 +0800)
commit429ef9ba9dcc8f92b8362c1b0fca0916db05e84b
tree8ee6eaa242961eb87b6375b0f24fbc99084802c9
parentce4e9c7096be1222592700cdad84cf35895159da
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>
apps/patchwork/bin/pwclient
templates/patchwork/pwclientrc