]> git.ozlabs.org Git - patchwork/log
patchwork
8 years agodocs: Use 'prod' and 'dev' requirements files
Stephen Finucane [Tue, 7 Apr 2015 21:20:51 +0000 (22:20 +0100)]
docs: Use 'prod' and 'dev' requirements files

Django 1.5 and 1.6 are no longer supported.

    https://docs.djangoproject.com/en/dev/internals/release-process/

As a result, one should not encourage people to develop and/or deploy
against these versions - the latest version of Django supported by
patchwork (currently 1.7) should be used for both.

In addition, rather than duplicating shared requirements for 'dev' and
'prod' environments, move all shared requirements to a "base" file.

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
8 years agosettings: Resolve all but one Django 1.7 warning
Stephen Finucane [Tue, 7 Apr 2015 21:20:50 +0000 (22:20 +0100)]
settings: Resolve all but one Django 1.7 warning

Resolve remaining Django 1.7 warnings with the exception of a single
deprecation warning. However, this remaining issue is really a
non-issue due to the limited (and non-offending) use of the code.

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
8 years agoviews: Replace 'mimetype' with 'content_type'
Stephen Finucane [Tue, 7 Apr 2015 21:20:49 +0000 (22:20 +0100)]
views: Replace 'mimetype' with 'content_type'

Passing 'mimetype' to 'HttpResponse' is deprecated in 1.6 and
removed in Django 1.7. Among other things, this causes some unit
tests to fail when using Django 1.7. Its replacement - 'content_type'
- is available in Django 1.5+. This can be seen here:

    https://docs.djangoproject.com/en/1.5/ref/request-response/#django.http.HttpResponse.__init__

This is therefore a like-for-like replacement.

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
8 years agoResolve removed 'AUTH_PROFILE_MODULE' setting
Stephen Finucane [Tue, 7 Apr 2015 21:20:48 +0000 (22:20 +0100)]
Resolve removed 'AUTH_PROFILE_MODULE' setting

The 'AUTH_PROFILE_MODULE' setting, and the 'get_profile()' method on
the 'User' model are removed in Django 1.7. This causes errors when
using Patchwork with Django 1.7+.

There are three changes necessary:

 * Replace profile model's 'ForeignKey' with a 'OneToOneField'
 * Remove all 'get_profile()' calls
 * Delete 'AUTH_PROFILE_MODULE' settings from 'settings.py'

These changes are discussed here:

    http://deathofagremmie.com/2014/05/24/retiring-get-profile-and-auth-profile-module/

Django 1.6 also introduces two other notable changes:

 * The 'XViewMiddleware' module has been moved
 * A new test runner has been introduced

It is not possible to fix these issues without breaking compatibility
with Django 1.5. As a result they have been ignored and must be
resolved in a future release.

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
8 years agoMake the submitter name link to a query for that submitter
Michael Ellerman [Mon, 23 Mar 2015 06:56:22 +0000 (17:56 +1100)]
Make the submitter name link to a query for that submitter

Currently the submitter name is rendered as a mailto: link. This is
possibly useful in some circumstances, but in my experience is not
usually what I want. Although it opens a mail to the submitter, it
doesn't include any of the patch context, so is not very helpful.

Instead the submitter link can be a link to a query for patches by that
submitter. In my experience that is more useful, ie. when looking at a
single patch for a submitter you can then quickly get the list of all
patches by them.

So do that conversion.

In order to do it we need to know the current project, so that becomes a
parameter to personify. I believe the url reversal is correct, though
it's not pretty, and pulling SubmitterFilter.param out feels a little
wrong, but is the best solution I could come up with.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
8 years agopwclient: honor PAGER for view
aldot [Mon, 2 Mar 2015 15:18:34 +0000 (16:18 +0100)]
pwclient: honor PAGER for view

Use the PAGER of the environment to view patches

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoparser: Fix parsing of patches with a trailing no-newline marker
Michael Ellerman [Wed, 18 Mar 2015 03:39:24 +0000 (14:39 +1100)]
parser: Fix parsing of patches with a trailing no-newline marker

If a patch ends with a "No newline at end of file" marker, it is
incorrectly considered part of the comment.

Add a testcase which shows the bug, and then fix the parser. The parser
fix is hopefully sufficiently specific so as to not break any other
unrelated case. But ..

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agoINSTALL: Fix indentation (whitespace only change) to 4 spaces
Bryce Harrington [Fri, 5 Dec 2014 21:23:09 +0000 (13:23 -0800)]
INSTALL: Fix indentation (whitespace only change) to 4 spaces

Also, 2 newlines after each section.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoINSTALL: Fix some minor typos
Bryce Harrington [Fri, 5 Dec 2014 21:23:07 +0000 (13:23 -0800)]
INSTALL: Fix some minor typos

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoAlways use #!/usr/bin/env python
Damien Lespiau [Sat, 15 Nov 2014 01:58:25 +0000 (01:58 +0000)]
Always use #!/usr/bin/env python

Hardcoding the path to the python binary breaks virtualenv. virtualenv
creates a special python binary in the path, and specifically using
/usr/bin/python breaks that.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: support 'archived' filtering and updating
Brian Norris [Sun, 23 Nov 2014 05:49:53 +0000 (21:49 -0800)]
pwclient: support 'archived' filtering and updating

Examples:

  # Mark patch as uperseded and archived
  pwclient update -s Superseded -a yes <ID>

  # List all archived patches
  pwclient list -a yes

Notably, we still leave the '-s' option as required for 'pwclient
update'; so you can't *just* archive a patch without setting its state.
I couldn't quite figure out the right argparse usage to represent that
the user must include one or both of '-s' and '-a'.

And of course, the server must have an updated xmlrpc that supports the
'archived' field for list filtering (recently patched), otherwise you'll
just get an empty list.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: drop unused variables
Brian Norris [Sun, 23 Nov 2014 05:49:52 +0000 (21:49 -0800)]
pwclient: drop unused variables

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoxmlrpc: support filtering by 'archived'
Brian Norris [Sun, 23 Nov 2014 05:49:51 +0000 (21:49 -0800)]
xmlrpc: support filtering by 'archived'

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: exit on first patch which fails to apply
Brian Norris [Sun, 23 Nov 2014 04:38:46 +0000 (20:38 -0800)]
pwclient: exit on first patch which fails to apply

When run with more than one patch ID, the 'apply' and 'git-am' commands
should not continue to process other patches if an earlier one failed.
We should stop so the user can address the situation.

Future work: it'd be nice to just pipe all the patches at once to
git-am, so that git's nice handling of fixup-and-continue workflow can
be used.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: add project option to single-patch commands
Brian Norris [Sun, 23 Nov 2014 04:38:45 +0000 (20:38 -0800)]
pwclient: add project option to single-patch commands

Previously, we could not target a particular server instance with the
apply, git-am, info, and view subcommands. Under a single-server design,
we never needed to target a particular project for a patch. We just
targeted the patch itself. But with the advent of multi-server
.pwclientrc configurations, we should allow pwclient to specify the
project for these commands.

This adds the '-p PROJECT' option to:
 * apply
 * git-am
 * info
 * view

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoINSTALL: fix mysql syntax
Brian Norris [Sun, 23 Nov 2014 04:38:44 +0000 (20:38 -0800)]
INSTALL: fix mysql syntax

You shouldn't quote ('') the database name. MySQL complains if you do.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoTODO: remove completed items
Brian Norris [Sun, 23 Nov 2014 04:38:43 +0000 (20:38 -0800)]
TODO: remove completed items

IIUC, these items have all been completed. (The 'bundle' part of
--signoff is not completed, but that is represented in the previous
bullet.)

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoxmlrpc: include UNIX mbox 'From ' header in patch_get_mbox()
Brian Norris [Sun, 23 Nov 2014 04:38:42 +0000 (20:38 -0800)]
xmlrpc: include UNIX mbox 'From ' header in patch_get_mbox()

This function is misleadingly named 'mbox'; the contents do not begin
with a proper 'From xxx <date>' separator line. (Notably, the mbox
format does not have an authoritative standard, but at least this basic
'separator' construct is noted in http://tools.ietf.org/html/rfc4155.)

The Message.as_string() function takes an optional [unixfrom] boolean
argument. Let's use it, like we do everywhere else (including in the web
interface 'mbox' link).

Among other things, this means that we can straightforwardly concatenate
the output of patch_get_mbox(), and more tools can use this output
as-is.

Example header:

>From patchwork Fri Nov 21 18:24:29 2014
...

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoxmlrpc: add 'archived' status to patch summary
Brian Norris [Sun, 23 Nov 2014 04:38:41 +0000 (20:38 -0800)]
xmlrpc: add 'archived' status to patch summary

This will now show up in 'pwclient info'.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoviews/xmlrpc: fix xmlrpc delegate filtering
Johannes Berg [Tue, 6 Jan 2015 10:21:37 +0000 (11:21 +0100)]
views/xmlrpc: fix xmlrpc delegate filtering

Trying to use
  pwclient list -d 'johannes@sipsolutions.net'

doesn't result in any patches listed - it seems that the filter is
constructed wrongly on the xmlrpc server side (going by how the
submitter filter is done.)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotest_notifications: Fix testNotificationUpdated timestamp comparison
Damien Lespiau [Sat, 8 Nov 2014 13:25:58 +0000 (13:25 +0000)]
test_notifications: Fix testNotificationUpdated timestamp comparison

With MySQL, the django ORM defaults to mapping DateTimeField to
Timestamp and this has only a precision of seconds.

Let's use >= here then, which doesn't affect the correctness of this
test.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodocs: Add a note about how to run tests
Damien Lespiau [Sat, 8 Nov 2014 13:25:57 +0000 (13:25 +0000)]
docs: Add a note about how to run tests

Given that hacking on patchwork is spaced in time, I always forget how
to do this. So write down a note.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agojquery: Fix jqeury typo
Damien Lespiau [Sat, 8 Nov 2014 13:25:23 +0000 (13:25 +0000)]
jquery: Fix jqeury typo

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoparsemail: Honour existing PYTHONPATH
Damien Lespiau [Sat, 25 Oct 2014 21:17:22 +0000 (22:17 +0100)]
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>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodocs: Add the Debian package name for virtualenv/mysql
Damien Lespiau [Sat, 25 Oct 2014 15:24:43 +0000 (16:24 +0100)]
docs: Add the Debian package name for virtualenv/mysql

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: add %{_msgid_} to print message-id without surrounding < and >
Jani Nikula [Tue, 21 Oct 2014 08:18:54 +0000 (11:18 +0300)]
pwclient: add %{_msgid_} to print message-id without surrounding < and >

The angle brackets are not really part of the message-id. Making it
possible to get the message-id without them is helpful.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: add output format option to list/search command
Jani Nikula [Tue, 21 Oct 2014 08:18:53 +0000 (11:18 +0300)]
pwclient: add output format option to list/search command

Make scripting easier by letting the user specify the output format. The
format string may contain tag references to fields, such as %{id} and
%{msgid}.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoCOPYING: Add the text of the GPLv2 license
Damien Lespiau [Tue, 30 Sep 2014 23:11:30 +0000 (00:11 +0100)]
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>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: Remove unhandled action 'save'
Bernhard Reutner-Fischer [Mon, 8 Sep 2014 15:24:25 +0000 (17:24 +0200)]
pwclient: Remove unhandled action 'save'

The 'save' action really is called 'get' (as opposed to 'view').

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: Rephrase patch_ids iterator
Bernhard Reutner-Fischer [Mon, 8 Sep 2014 15:24:24 +0000 (17:24 +0200)]
pwclient: Rephrase patch_ids iterator

Don't generate an empty array, use for-loop instead
as noticed by Jacob E. Keller

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: Simplify argument handling
Bernhard Reutner-Fischer [Mon, 8 Sep 2014 15:24:23 +0000 (17:24 +0200)]
pwclient: Simplify argument handling

dict().get() returns a default of None, use that to initialize our
internal variables.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: add --help / -? to all sub commands
Bernhard Reutner-Fischer [Mon, 8 Sep 2014 15:24:22 +0000 (17:24 +0200)]
pwclient: add --help / -? to all sub commands

Remove over-cautious helptext printing while at it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agosettings: Make sure to use a tuple for TEMPLATE_DIRS
Damien Lespiau [Thu, 4 Sep 2014 23:57:37 +0000 (00:57 +0100)]
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>
9 years agodocs: Add requirements.txt for django 1.7/MySQL
Damien Lespiau [Thu, 4 Sep 2014 23:46:40 +0000 (00:46 +0100)]
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>
9 years agodocs: Add requirements.txt for django 1.6/MySQL
Damien Lespiau [Thu, 4 Sep 2014 23:46:39 +0000 (00:46 +0100)]
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>
9 years agodocs: Add requirements.txt for django 1.5/MySQL
Damien Lespiau [Thu, 4 Sep 2014 23:46:38 +0000 (00:46 +0100)]
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>
9 years agoHACKING: Add some documentation about using virtualenv with patchwork
Damien Lespiau [Thu, 4 Sep 2014 23:46:37 +0000 (00:46 +0100)]
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>
9 years agoINSTALL: Sprinkle a few UTF-8 in the mysql documentation
Damien Lespiau [Sun, 31 Aug 2014 00:02:37 +0000 (01:02 +0100)]
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>
9 years agoINSTALL: Update the database configuration instructions
Damien Lespiau [Sun, 31 Aug 2014 00:02:36 +0000 (01:02 +0100)]
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>
9 years agopwclient: preserve ordering of patch ids
Jeremy Kerr [Sun, 7 Sep 2014 12:05:18 +0000 (20:05 +0800)]
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>
9 years agopwclient: diagnose hash_parser errors gracefully
Bernhard Reutner-Fischer [Fri, 29 Aug 2014 12:02:08 +0000 (14:02 +0200)]
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>
9 years agopwclient: allow multiple IDs
Bernhard Reutner-Fischer [Fri, 29 Aug 2014 09:07:02 +0000 (11:07 +0200)]
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>
9 years agopwclient: support signoff in the pwclientrc
Bernhard Reutner-Fischer [Mon, 18 Aug 2014 19:20:02 +0000 (21:20 +0200)]
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>
9 years agopwclient: Remove now obsolete usage()
Bernhard Reutner-Fischer [Mon, 18 Aug 2014 19:07:50 +0000 (21:07 +0200)]
pwclient: Remove now obsolete usage()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: simplify hash/id handling
Bernhard Reutner-Fischer [Mon, 18 Aug 2014 19:07:49 +0000 (21:07 +0200)]
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>
9 years agopwclient: add git-am -s support
Bernhard Reutner-Fischer [Mon, 18 Aug 2014 19:07:48 +0000 (21:07 +0200)]
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>
9 years agoparsemail: Fallback to common charsets when charset is None or x-unknown
Siddhesh Poyarekar [Mon, 14 Jul 2014 02:21:32 +0000 (10:21 +0800)]
parsemail: Fallback to common charsets when charset is None or x-unknown

We recently encountered a case in our glibc patchwork instance on
sourceware, where a patch was dropped because it had x-unknown
charset.

This change adds a fallback on a set of encodings (instead of just
utf-8) when the charset is not mentioned or if it is set as x-unknown.

Minor changes and testcase by Jeremy Kerr <jk@ozlabs.org>

Signed-off-by: Siddhesh Poyarekar <siddhesh@redhat.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopost-receive: exclude commits from the patch update step
Brian Norris [Thu, 12 Jun 2014 01:54:59 +0000 (18:54 -0700)]
post-receive: exclude commits from the patch update step

When merging upstream work related to other projects into your own
project repository, you probably don't want to check for (and try to
update) the status on every change-set in the merge. So add a list of
references (branches, tags, commits, etc.) whose commits should be
ignored in the patch update step.

This could be used, for example, to set:

    EXCLUDE="refs/heads/upstream"

Then when you're ready to merge in new upstream code, you first update
the 'upstream' branch before pushing your own.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoviews: fix patch_to_mbox() for postscript
Andreas Bießmann [Tue, 19 Nov 2013 14:44:02 +0000 (15:44 +0100)]
views: fix patch_to_mbox() for postscript

Before we changed the comment 'some comment\n---\n some/file | 1 +'
to 'some comment\n\n---\nsome/file | 1 +\n'. Now we pass this comment
unchanged.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotests/mboxviews: test for unchanged postscript
Andreas Bießmann [Tue, 19 Nov 2013 14:44:01 +0000 (15:44 +0100)]
tests/mboxviews: test for unchanged postscript

Currently a patch containing postscript is always modified in patch_to_mbox()
compared to the input patch.

A comment containing 'some comment\n---\n some/file | 1 +' will be changed to
'some comment\n\n---\nsome/file | 1 +\n' which is annoying.

This patch adds a test to detect that, a follow up patch will fix the error
then.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agosettings.py: use python to find ROOT_DIR
Andreas Bießmann [Tue, 19 Nov 2013 14:44:00 +0000 (15:44 +0100)]
settings.py: use python to find ROOT_DIR

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoINSTALL: adopt PYTHONPATH
Andreas Bießmann [Tue, 19 Nov 2013 14:43:59 +0000 (15:43 +0100)]
INSTALL: adopt PYTHONPATH

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotemplates: fixup HTML tags
Brian Norris [Sat, 10 May 2014 01:40:47 +0000 (18:40 -0700)]
templates: fixup HTML tags

These tags aren't matched appropriately.

There may well be others, but I caught these by a mix of eyes and
Firefox's source viewer.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: add bash completion for project names
Yann E. MORIN [Tue, 1 Jul 2014 18:14:25 +0000 (20:14 +0200)]
pwclient: add bash completion for project names

Add initial bash-completion, which so far only completes on the
project names.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopwclient: accept more than one project in ~/.pwclientrc
Yann E. MORIN [Tue, 1 Jul 2014 18:14:24 +0000 (20:14 +0200)]
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>
9 years agopwclient: rename variable CONFIG_FILES to be singular
Yann E. MORIN [Tue, 1 Jul 2014 18:14:23 +0000 (20:14 +0200)]
pwclient: rename variable CONFIG_FILES to be singular

We only support a single config file, so there is no need to have a
plural in this variable.

Also, we'll need to know what the default config file is, when we want
to save it to migrate to the new format.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agofilters: fix exception in filter querystring generation
Jeremy Kerr [Thu, 8 May 2014 05:53:09 +0000 (13:53 +0800)]
filters: fix exception in filter querystring generation

We get a silent (as it's during template render) exception when
generating filter querystrings, as we're passing a list to the string
format operator rather than a tuple.

This change removes the map and explicitly applies sanitise to the
(name, value) pair.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotests/utils: Fix List-Id headers on emails from create_email
Jeremy Kerr [Tue, 3 Jun 2014 13:15:42 +0000 (21:15 +0800)]
tests/utils: Fix List-Id headers on emails from create_email

We need to use the project's List Id in the List-Id header, not the
linkname.

We'll also need to populate the .listid member of defaults.project.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoviews/generic_list: reduce number of queries in list rendering
Jeremy Kerr [Wed, 7 May 2014 12:24:17 +0000 (20:24 +0800)]
views/generic_list: reduce number of queries in list rendering

Currently, we do two database queries per patch on a list view; one to
retrieve the submitter, and one for the state.

This patch adds a .select_related to fetch for the submitter and state,
and a .defer() to prevent loading large amounts of text data from the
patch content and headers.

This gives a significant reduction in the work per request. For a
paginated list view (ie 100 patches per page):

                          before        after
  User                   1344 ms       228 ms
  System                  170 ms        25 ms
  Total                  1514 ms       253 ms
  Elapsed                1605 ms       274 ms

  Context switch (vol)   4206           40
  Context switch (invol)  326           75

  SQL queries             212           15
  Longest query            13 ms         5 ms
  Total query time        121 ms        20 ms

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agomigration: Add cleanup-people migration script
Jeremy Kerr [Wed, 7 May 2014 05:06:35 +0000 (13:06 +0800)]
migration: Add cleanup-people migration script

Now that we only create Person object once the User has been confirmed,
we can clean up unused Person objects from the database.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotemplates: display projects as inline-block elements
Jeremy Kerr [Wed, 7 May 2014 03:23:04 +0000 (11:23 +0800)]
templates: display projects as inline-block elements

... rather than one long list.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agomodels: order projects by linkname by default
Jeremy Kerr [Wed, 7 May 2014 02:07:57 +0000 (10:07 +0800)]
models: order projects by linkname by default

So we get a sensible list of projects on the front page's project list.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotests: Add XMLRPC interface test
Jeremy Kerr [Wed, 7 May 2014 02:03:44 +0000 (10:03 +0800)]
tests: Add XMLRPC interface test

This change adds a simple test for the XMLRPC interface, essentially to
ensure that configuration changes haven't broken accessibility to the
interface.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agourls: Fix django-1.6 change in password change views
Jeremy Kerr [Wed, 7 May 2014 01:06:15 +0000 (09:06 +0800)]
urls: Fix django-1.6 change in password change views

The expected name for the password change views no longer has the auth_
prefix. This change fixes this and adds a testcase.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoviews/xmlrpc: request.raw_post_data has been deprecated
Jeremy Kerr [Tue, 6 May 2014 23:48:35 +0000 (07:48 +0800)]
views/xmlrpc: request.raw_post_data has been deprecated

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoutils/Order: Fix application of ordering
Jeremy Kerr [Thu, 24 Apr 2014 03:28:31 +0000 (11:28 +0800)]
utils/Order: Fix application of ordering

We can't just re-apply orderings to the same queryset, we need to apply
all at once.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodocs/INSTALL: Add setup details for patchwork cron script
Jeremy Kerr [Thu, 24 Apr 2014 01:52:07 +0000 (09:52 +0800)]
docs/INSTALL: Add setup details for patchwork cron script

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agotests: Make tests compatible with django 1.6
Jeremy Kerr [Wed, 23 Apr 2014 13:02:46 +0000 (21:02 +0800)]
tests: Make tests compatible with django 1.6

The default test runner in django 1.6 relies on tests being named
test*.py, rather that an explicit <appname>.test module.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoFix django-1.6 incompatibilities
Jeremy Kerr [Tue, 22 Apr 2014 13:19:52 +0000 (21:19 +0800)]
Fix django-1.6 incompatibilities

We're seeing a couple of final quirks running the testsuite on django
1.6:

  Traceback (most recent call last):
    File "patchwork/apps/patchwork/tests/notifications.py", line 182, in testNotificationEscaping
      errors = send_notifications()
    File "patchwork/apps/patchwork/utils.py", line 227, in send_notifications
      delete_notifications()
    File "patchwork/apps/patchwork/utils.py", line 197, in delete_notifications
      pk__in = notifications).delete()
    File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 163, in filter
      return self.get_queryset().filter(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 590, in filter
      return self._filter_or_exclude(False, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 608, in _filter_or_exclude
      clone.query.add_q(Q(*args, **kwargs))
    File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1198, in add_q
      clause = self._add_q(where_part, used_aliases)
    File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1232, in _add_q
      current_negated=current_negated)
    File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1122, in build_filter
      lookup_type, value)
    File "/usr/lib/python2.7/dist-packages/django/db/models/fields/related.py", line 1107, in get_lookup_constraint
      values = [get_normalized_value(value) for value in raw_value]
    File "/usr/lib/python2.7/dist-packages/django/db/models/fields/related.py", line 1084, in get_normalized_value
      value_list.append(getattr(value, source.attname))
  AttributeError: 'PatchChangeNotification' object has no attribute 'id'

- we're specifying our own pk here, so the PatchChangeNotification has
no id attribute; it looks like the pk__in syntax is expecting IDs.

We also need a default value for BooleanField, as we're getting
integrity errors when creating rows with no explicit send_notifications
set.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agotests/utils: Don't rely on field error message API
Jeremy Kerr [Tue, 22 Apr 2014 13:09:51 +0000 (21:09 +0800)]
tests/utils: Don't rely on field error message API

The location of EmailField's message changed in 1.6, just use a fixed
string instead.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agotests/patchparser: Inherit from djagno.test.TestCase
Jeremy Kerr [Tue, 22 Apr 2014 13:03:05 +0000 (21:03 +0800)]
tests/patchparser: Inherit from djagno.test.TestCase

Since these tests may touch the database, we need the transaction
handling that django.test.TestCase provides.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agolib/sql: remove references to auth_message model
Jeremy Kerr [Tue, 22 Apr 2014 12:50:19 +0000 (20:50 +0800)]
lib/sql: remove references to auth_message model

The Message model was deprecated in 1.4, and removed in 1.6

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoDefer Person creation/linkage until registration is confirmed
Jeremy Kerr [Tue, 22 Apr 2014 12:48:19 +0000 (20:48 +0800)]
Defer Person creation/linkage until registration is confirmed

We currently create Person objects when a registration is submitted, not
when it is confirmed. This can lead to stale Person objects for
unconfirmed registrations.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoAdd unconfirmed registration expiry
Jeremy Kerr [Tue, 22 Apr 2014 12:08:27 +0000 (20:08 +0800)]
Add unconfirmed registration expiry

Currently, unconfirmed registrations remain in the database. Although we
have an expiry for the registrations, we don't actually remove rows from
the database. This can clog the admin interface up with unnecessary
registration spam.

We currently have a patchwork cron script to send notifications on patch
changes, so hook this into a new do_expiry function.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoUpdate manage.py to post a post-1.4 version.
Jeremy Kerr [Mon, 21 Apr 2014 03:06:37 +0000 (11:06 +0800)]
Update manage.py to post a post-1.4 version.

Django version 1.6 deprecates some of the django.core.management API, so
we need a post-1.4 version.

The semantics with app include paths have changed with this version, so
update the urlconf to use the same path as manage.py.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoRemove references to django.conf.urls.defaults
Jeremy Kerr [Mon, 21 Apr 2014 02:56:32 +0000 (10:56 +0800)]
Remove references to django.conf.urls.defaults

django.conf.urls.defaults has been deprecated, replace with
django.conf.urls, and remove the 'import *' syntax.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoviews/order: Apply default ordering as secondary
Jeremy Kerr [Wed, 12 Mar 2014 00:44:12 +0000 (08:44 +0800)]
views/order: Apply default ordering as secondary

If we're ordering by a certain non-default field, then the ordering
of patches with that same field will be arbitrary.

This change applies the default as a secondary ordering, so we're not
left with an arbitrary sub-order.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agopost-receive: Fix error message when pushing to an unmapped branch
Carl Worth [Fri, 13 Dec 2013 04:28:02 +0000 (20:28 -0800)]
post-receive: Fix error message when pushing to an unmapped branch

Previously, if STATE_MAP contained only refs/heads/master and a user
pushed to a branch such as refs/heads/stable, the hook emitted a
misleading error message:

E: no mapping for refname refs/heads/master

Fix this by correctly printing the reference being looked for, rather
than the reference most recently found in STATE_MAP. Also, reword the
message slightly to point the user to STATE_MAP and to use an actual
word "branch" instead of the non-word "refname".

Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodocs: Add a pointer to the git post-receive hook
Carl Worth [Wed, 11 Dec 2013 18:46:28 +0000 (10:46 -0800)]
docs: Add a pointer to the git post-receive hook

I had to stumble upon this feature before I realized it was here
inside the tools directory all along. This documentation should make
it easier for the next person coming along looking for a patchwork git
hook.

Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoMake the post-receive hook more efficient (using pwclient info, not view)
Carl Worth [Wed, 11 Dec 2013 18:46:27 +0000 (10:46 -0800)]
Make the post-receive hook more efficient (using pwclient info, not view)

Older versions of patchwork shipped with a version of pwclient that
had the view command, but not info command. Now that info exists, it's
inefficient to use it to obtain the patchwork ID value, (since it
requires the server to send the entire patch content in response to an
XML RPC request).

So be kind to the server by using info instead, (which has a small,
fixed-length response).

Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agotools/post-receive.hook: don't update the previously pushed commit
Carl Worth [Wed, 11 Dec 2013 18:46:26 +0000 (10:46 -0800)]
tools/post-receive.hook: don't update the previously pushed commit

Previously, the post-receive hook would always examine one commit that
had been previously pushed, (when the purpose of the hook is only to
example newly-pushed commits). We fix this by simply dropping the '^'
in the commit-range specification.

Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agopwclient: fix handling UTF-8 in patch info
Andreas Bießmann [Mon, 9 Dec 2013 12:30:53 +0000 (13:30 +0100)]
pwclient: fix handling UTF-8 in patch info

This patch fixes following error when redirecting 'pwclient info' output:

---8<---
andreas@dockstar % pwclient info 295268 > /tmp/test.out
Traceback (most recent call last):
  File "/home/andreas/bin/pwclient", line 508, in <module>
    main()
  File "/home/andreas/bin/pwclient", line 471, in main
    action_info(rpc, patch_id)
  File "/home/andreas/bin/pwclient", line 242, in action_info
    print("- %- 14s: %s" % (key, value))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 29: ordinal not in range(128)
--->8---

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodocs: We're targetting django 1.5 now
Jeremy Kerr [Sun, 13 Oct 2013 07:09:48 +0000 (15:09 +0800)]
docs: We're targetting django 1.5 now

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoAdd a config option to FORCE_HTTPS_LINKS
Konstantin Ryabitsev [Fri, 11 Oct 2013 14:47:30 +0000 (10:47 -0400)]
Add a config option to FORCE_HTTPS_LINKS

In situations where SSL is terminated at the load-balancer, we cannot
rely on guessing the scheme based on whether patchwork itself was
accessed via http or https, since the last-leg is always going to be
done over http.

Unfortunately, wrongly using http:// URLs results in unusable
.pwclientrc files, since xmlrpc does not handle http->https redirects
and instead displays a traceback.

This change introduces a FORCE_HTTPS_LINKS option, which forces
pwclientrc links to always return "https" regardless of how the project
itself is accessed.

It appears that the http/https check is currently only used for
generating pwclientrc -- a lot of other places seem to hardcode
"http://" and rely on the server to transparently upgrade the
connection. This is not a secure approach (it allows for MITM and
SSL-Strip attacks) and therefore all places currently hardcoding
http://{{site.domain}} and similar should be switched to using the
"sheme" variable, the same as done for generating pwclientrc files.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agolib/sql/migration: Fix column names for MySQL/MariaDB
Ralf Baechle [Mon, 29 Jul 2013 14:46:33 +0000 (16:46 +0200)]
lib/sql/migration: Fix column names for MySQL/MariaDB

The first issue is that patchwork was no longer accepting new patches via
the apps/patchwork/bin/parsemail.sh script.  When I was trying to invoke
it manually, it only printed "no project found".  I was able to figure
out that this was caused by changes to the database scheme which are taken
care of by the two SQL scripts:

  lib/sql/migration/012-project-add-columns.sql
  lib/sql/migration/013-bundle-names.sql

The catch - these first script don't run with MySQL - or rather MariaDB that
Fedora has switched to.  MariaDB doesn't like the quotes around the table
and column names.  Patch below.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agotests: Use strings from fields module for error tests
Jeremy Kerr [Sun, 13 Oct 2013 06:49:06 +0000 (14:49 +0800)]
tests: Use strings from fields module for error tests

Rather than hard-coding expected error messages, grab the values from
the fields module, and expose through the test utils.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoDjango 1.5 compatibility fixes
Ralf Baechle [Thu, 3 Oct 2013 16:45:47 +0000 (18:45 +0200)]
Django 1.5 compatibility fixes

Django 1.5 wants plenty of quotes scattered over the templates.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoparser: Add support for rename-only patches
Jeremy Kerr [Sun, 13 Oct 2013 05:40:00 +0000 (13:40 +0800)]
parser: Add support for rename-only patches

Yann E. MORIN reported a problem where patchwork drops patches with only
renames:

 http://lists.busybox.net/pipermail/buildroot/2013-October/079999.html

This change fixes the issue by adding a new state for patch 'meta'
headers: header test which is not parsed as a hunk, but has the same
behaviour as a hunk in that it will cause the patchbuf to be populated.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoviews/base: Implement limit for submitter autocompletion
Jeremy Kerr [Sun, 13 Oct 2013 05:04:31 +0000 (13:04 +0800)]
views/base: Implement limit for submitter autocompletion

Add a limit parameter to the completion view, and pass a limit of 20
results in the javascript.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoviews/base: Include email addresses in submitter autocomplete search
Jeremy Kerr [Sun, 13 Oct 2013 04:48:21 +0000 (12:48 +0800)]
views/base: Include email addresses in submitter autocomplete search

Currently, we only search names, which is a problem for Person objects
with only an email address set. This change includes the email addresses
in the search.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodocs: also mention that ROOT_DIR needs to be updated
Florian Fainelli [Tue, 1 Oct 2013 17:39:20 +0000 (18:39 +0100)]
docs: also mention that ROOT_DIR needs to be updated

When the patchwork installation resides in the non-default location
(/srv/patchwork) make sure that local_settings.py also gets updated with
a proper ROOT_DIR value otherwise various problems will happen.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agosql: remove non-existing auth_message table
Florian Fainelli [Tue, 1 Oct 2013 17:39:19 +0000 (18:39 +0100)]
sql: remove non-existing auth_message table

During a recent installation the grant-all MySQL script was erroring out
because the "auth_message" table does not exist, remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodocs: fix INSTALL instructions regarding Django
Florian Fainelli [Tue, 1 Oct 2013 17:39:18 +0000 (18:39 +0100)]
docs: fix INSTALL instructions regarding Django

Django is no longer accessible using the old Subversion URL, update that
to the Github repository. Besides, the command-line used to perform the
"syncdb" operation does not work because we are off by one directory in
the filesystem, fix that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agosql: update grant-all.mysql.sql
Florian Fainelli [Tue, 1 Oct 2013 17:39:17 +0000 (18:39 +0100)]
sql: update grant-all.mysql.sql

The MySQL grant all script has a typo on the table
"patchwork_bundle_patches" vs "patchwork_bundlepatch" update that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodocs: update MySQL documentation bits
Florian Fainelli [Tue, 1 Oct 2013 17:39:16 +0000 (18:39 +0100)]
docs: update MySQL documentation bits

The MySQL documentation bits where missing a few important details for
installation setup to succeed like:

- having proper python-mysqldb support
- overriding the DATABASE_ENGINE to "mysql" for django to succeed in the
  "syncdb" operation

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agonotifications: add project name to patch update notification
Wolfram Sang [Fri, 17 May 2013 10:23:05 +0000 (12:23 +0200)]
notifications: add project name to patch update notification

Based on a feature request & patch from Wolfram Sang
<wsa@the-dreams.de>.

Notifications may span multiple projects, so include a summary in the
subject line, and detail in the header.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoDon't use total_seconds for python < 2.7
Konstantin Ryabitsev [Thu, 13 Jun 2013 14:50:56 +0000 (10:50 -0400)]
Don't use total_seconds for python < 2.7

The total_seconds function was added to datetime in python-2.7. For
compatibility with previous versions of python, use its suggested
equivalent (except drop microseconds, since we don't care about them in
this context).

Signed-off-by: Konstantin Ryabitsev <mricon@kernel.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agojs: Add jquery and jquery tablednd plugins
Jeremy Kerr [Sun, 16 Jun 2013 08:35:21 +0000 (16:35 +0800)]
js: Add jquery and jquery tablednd plugins

Based on a change from Andreas Bießmann <andreas@biessmann.de>.

Rather than requiring a download of the jquery library + tablednd
plugin, commit these to the repository.

In doing so, we upgrade to version 1.10.1 of jqeury, and the current
stable tablednd.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agotest/mboxviews: Add test for header-supplied dates
Jeremy Kerr [Mon, 10 Jun 2013 04:29:34 +0000 (12:29 +0800)]
test/mboxviews: Add test for header-supplied dates

Check that a Date: header in the original message is equivalent to the
header generated in the mbox output.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoviews/mbox: Use Date: header from original message
Jeremy Kerr [Mon, 10 Jun 2013 03:50:21 +0000 (11:50 +0800)]
views/mbox: Use Date: header from original message

Since we use UTC for internal date storage, we lose the timestamp info
from the original patch submissions. This means that the mbox views
(which are typically passed through to SCM commit logs) lose the
timezone information.

This change uses the Date header from the original message, if possible.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>