aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* docs: Use 'prod' and 'dev' requirements filesStephen Finucane2015-05-03
| | | | | | | | | | | | | | | | 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>
* settings: Resolve all but one Django 1.7 warningStephen Finucane2015-05-03
| | | | | | | | | 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>
* views: Replace 'mimetype' with 'content_type'Stephen Finucane2015-05-03
| | | | | | | | | | | | | | 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>
* Resolve removed 'AUTH_PROFILE_MODULE' settingStephen Finucane2015-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Make the submitter name link to a query for that submitterMichael Ellerman2015-05-03
| | | | | | | | | | | | | | | | | | | | | | 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>
* pwclient: honor PAGER for viewaldot2015-05-03
| | | | | | | 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>
* parser: Fix parsing of patches with a trailing no-newline markerMichael Ellerman2015-03-22
| | | | | | | | | | | 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>
* INSTALL: Fix indentation (whitespace only change) to 4 spacesBryce Harrington2015-03-22
| | | | | | | Also, 2 newlines after each section. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* INSTALL: Fix some minor typosBryce Harrington2015-03-22
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Always use #!/usr/bin/env pythonDamien Lespiau2015-03-22
| | | | | | | | | 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>
* pwclient: support 'archived' filtering and updatingBrian Norris2015-03-22
| | | | | | | | | | | | | | | | | | | | | | 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>
* pwclient: drop unused variablesBrian Norris2015-03-22
| | | | | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: support filtering by 'archived'Brian Norris2015-03-22
| | | | | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: exit on first patch which fails to applyBrian Norris2015-03-22
| | | | | | | | | | | | | 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>
* pwclient: add project option to single-patch commandsBrian Norris2015-03-22
| | | | | | | | | | | | | | | | | | 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>
* INSTALL: fix mysql syntaxBrian Norris2015-03-22
| | | | | | | 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>
* TODO: remove completed itemsBrian Norris2015-03-22
| | | | | | | | | 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>
* xmlrpc: include UNIX mbox 'From ' header in patch_get_mbox()Brian Norris2015-03-22
| | | | | | | | | | | | | | | | | | | | | | | 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>
* xmlrpc: add 'archived' status to patch summaryBrian Norris2015-03-22
| | | | | | | This will now show up in 'pwclient info'. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/xmlrpc: fix xmlrpc delegate filteringJohannes Berg2015-03-22
| | | | | | | | | | | | 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>
* test_notifications: Fix testNotificationUpdated timestamp comparisonDamien Lespiau2014-11-10
| | | | | | | | | | | 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>
* docs: Add a note about how to run testsDamien Lespiau2014-11-10
| | | | | | | | 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>
* jquery: Fix jqeury typoDamien Lespiau2014-11-10
| | | | | Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsemail: Honour existing PYTHONPATHDamien Lespiau2014-11-10
| | | | | | | | | 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>
* docs: Add the Debian package name for virtualenv/mysqlDamien Lespiau2014-11-10
| | | | | Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: add %{_msgid_} to print message-id without surrounding < and >Jani Nikula2014-11-10
| | | | | | | | 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>
* pwclient: add output format option to list/search commandJani Nikula2014-11-10
| | | | | | | | | 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>
* COPYING: Add the text of the GPLv2 licenseDamien Lespiau2014-11-10
| | | | | | | | 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>
* pwclient: Remove unhandled action 'save'Bernhard Reutner-Fischer2014-11-10
| | | | | | | 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>
* pwclient: Rephrase patch_ids iteratorBernhard Reutner-Fischer2014-11-10
| | | | | | | | 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>
* pwclient: Simplify argument handlingBernhard Reutner-Fischer2014-11-10
| | | | | | | | 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>
* pwclient: add --help / -? to all sub commandsBernhard Reutner-Fischer2014-11-10
| | | | | | | 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>
* settings: Make sure to use a tuple for TEMPLATE_DIRSDamien Lespiau2014-09-07
| | | | | | | | 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>
* docs: Add requirements.txt for django 1.7/MySQLDamien Lespiau2014-09-07
| | | | | | | | 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>
* docs: Add requirements.txt for django 1.6/MySQLDamien Lespiau2014-09-07
| | | | | 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/MySQLDamien Lespiau2014-09-07
| | | | | 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 patchworkDamien Lespiau2014-09-07
| | | | | | | | | 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>
* INSTALL: Sprinkle a few UTF-8 in the mysql documentationDamien Lespiau2014-09-07
| | | | | | | | | | | | | | | | | 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>
* INSTALL: Update the database configuration instructionsDamien Lespiau2014-09-07
| | | | | | | | | 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>
* pwclient: preserve ordering of patch idsJeremy Kerr2014-09-07
| | | | | | | | | | | 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>
* pwclient: diagnose hash_parser errors gracefullyBernhard Reutner-Fischer2014-09-07
| | | | | | | | | | | 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: allow multiple IDsBernhard Reutner-Fischer2014-09-07
| | | | | | | | | | | | | | | | | | | | 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: support signoff in the pwclientrcBernhard Reutner-Fischer2014-09-07
| | | | | | | | | | | | 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: Remove now obsolete usage()Bernhard Reutner-Fischer2014-09-07
| | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: simplify hash/id handlingBernhard Reutner-Fischer2014-09-07
| | | | | | | 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: add git-am -s supportBernhard Reutner-Fischer2014-09-07
| | | | | | | 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>
* parsemail: Fallback to common charsets when charset is None or x-unknownSiddhesh Poyarekar2014-07-24
| | | | | | | | | | | | | | 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>
* post-receive: exclude commits from the patch update stepBrian Norris2014-07-24
| | | | | | | | | | | | | | | | | | 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>
* views: fix patch_to_mbox() for postscriptAndreas Bießmann2014-07-24
| | | | | | | | | 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>
* tests/mboxviews: test for unchanged postscriptAndreas Bießmann2014-07-24
| | | | | | | | | | | | | | 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>