pwclient: add git-am -s support

Optionally pass --signoff to git-am

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
pwclient: simplify hash/id handling

and obtain "action" from args.subcmd while at it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
pwclient: Remove now obsolete usage()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
pwclient: support signoff in the pwclientrc

Try to obtain git-am '--signoff' settings from:
  - the commandline
  - the global option section
  - per-project section

v2: handle NoOptionError

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
pwclient: allow multiple IDs

Allow commands that take an ID to operate on multiple IDs.
E.g.:
update -s Superseded 1 2 3 4 5
apply 2 4 6

Reject update -c COMMIT-REF on multiple IDs though as that does not
make sense.

Implementation note:
nargs='*' instead of '?' results in (wrong/inconvenient):
mutually exclusive arguments must be optional
So remove mutual exclusive handling via argparse and instead do it by
hand. This might be implemented more conveniently in later python but we
(have to) stick with 2.7.x for the time being.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
pwclient: diagnose hash_parser errors gracefully

a386e636cc0adaa760a66b6ab042178027fc45c7 removed argparse mutual
exclusive group, so manually diagnose:

1) missing required hash_str / IDs
2) if both hash_str as well as IDs are seen

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
pwclient: preserve ordering of patch ids

Currently, we use a frozenset to remove duplicates in the patch id
list. However, this means we lose the patch ordering, which is important
for a git-am.

This change drops the frozenset, so we preserve the ordering from the
arguments.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
INSTALL: Update the database configuration instructions

That's the "new" (django 1.5+) way of defining databases, strictly
following the instructions wasn't working. This should save the next
user a bit of time.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
INSTALL: Sprinkle a few UTF-8 in the mysql documentation

When not specifying the charset/collation, I managed to create a latin1
database where all strings were encoded in latin1. That's really not
ideal. Adding 'CHARACTER SET utf8' when creating the DB fixes it. Then:

$ ./manage.py syncdb

will correctly create tables with UTF-8 encoded rows.

However, for some reason, when django creates the test tables, that
default, DB wide, encoding is not respected and one needs to provide an
additional TEST_CHARSET entry in the config dictionary.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
HACKING: Add some documentation about using virtualenv with patchwork

virtualenv is super nice to isolate devevelopment from the python
packages installed in the sytem. It also allows to have parallel
configurations to run tests againsts.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
docs: Add requirements.txt for django 1.5/MySQL

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
docs: Add requirements.txt for django 1.6/MySQL

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
docs: Add requirements.txt for django 1.7/MySQL

Note: a lot of tests fail due to the removal of the long deprecated
AUTH_PROFILE_MODULE.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
settings: Make sure to use a tuple for TEMPLATE_DIRS

Django 1.7 has added a check to make sure TEMPLATE_DIRS is a tuple. We
were missing a ',', the key piece to define a tuple with one element.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
COPYING: Add the text of the GPLv2 license

I missed having that file when I first looked at the git repository to
figure out the license of the project. So add one.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
docs: Add the Debian package name for virtualenv/mysql

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
parsemail: Honour existing PYTHONPATH

For setups where the patchwork dependencies are not part of the system
packages, one needs to indicate where to find them. parsemail.sh was
overriding PYTHONPATH without leaving us a chance to join in.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>