summaryrefslogtreecommitdiffstats
path: root/apps
Commit message (Collapse)AuthorAgeFilesLines
...
* Use an explicit initial default patch stateDirk Wallenstein2012-04-302-4/+7
| | | | | | | | | | | This will make editing states through the admin UI less error-prone, and will facilitate parsing patches when relying on a default state, as well as testing. Use the explicit default state when parsing mails. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: allow words starting with "diff" at beginning of lineStefan Hajnoczi2012-01-142-1/+6
| | | | | | | | | | | | | | | The patch parser splits emails incorrectly when the comment contains a line whose first word starts with "diff" (like "difficult" or "different"). For a real-life example of an email that triggers this bug, see http://patchwork.ozlabs.org/patch/135291/. Fix the issue by checking for a space after "diff". Add DiffWordInCommentTest to the test suite. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/patchparser: Add CVS format patch testJeremy Kerr2011-12-082-0/+142
| | | | | | | Test that CVS-formatted patches are parsed correctly, and that we capture the correct 'Index: ' metadata. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: add abstract mbox parsing testJeremy Kerr2011-12-081-7/+9
| | | | | | | Add a new class to handle mbox-parsing code, abstracting what is done by the current git-pull tests. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* filters: handle utf-8 characters when building filter querystringJeremy Kerr2011-12-082-2/+17
| | | | | | | | | | | | | Currently, we build the filter querystring by passing the raw string to urllib.quote, which expects an encoded string. When the raw string (in this case, a unicode object) contains a unicode character, quote() raises a KeyError. This fixes the problem by encoding the parameter name and values to UTF-8 first. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork: new pwclient git-am actiondavid decotigny2011-11-251-3/+20
| | | | | | | | | This commit adds a new "pwclient git-am" action which applies given patch ID on the current git branch using "git am". It's convenient to keep track and authorship of patches applied locally from a patchwork server. Signed-off-by: David Decotigny <david.decotigny@google.com>
* parser: allow other protocol types in pull-request handlingJeremy Kerr2011-11-255-1/+1055
| | | | | | Change the parser's regex to allow other protocol types, not just git:// Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Update Person & UserProfile object whenever User is savedJeremy Kerr2011-09-192-5/+46
| | | | | | | | | | | | Currently, UserProfiles are only saved on creation of the User object, before the first_name and last_name attributes are set. This means that we fallback to using the User.username value as the new Person.name. This change modifies User's post-save signal to always update the Person object, both on creation and updates. This means we get the proper name appearing on Person instances. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Merge branch 'notifications'Jeremy Kerr2011-09-1917-68/+1316
|\
| * notifications: implement opt-outnotificationsJeremy Kerr2011-04-143-3/+29
| | | | | | | | | | | | Check for opt-out status before sending notification mail. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * notifications: Add NOTIFICATION_FROM_EMAIL settingJeremy Kerr2011-04-142-1/+2
| | | | | | | | | | | | Allow a separate From: address for notificaton emails. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * notifications: Add code to send notificationsJeremy Kerr2011-04-144-1/+185
| | | | | | | | | | | | | | | | | | Add a function (patchwork.utils.send_notifications) to process the PatchChangeNotification queue. We try to group mail to the same sender, by waiting settings.NOTIFICATION_DELAY_MINUTES to allow other notifications to arrive. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * models: Add PatchChangeNotification and record patch state changesJeremy Kerr2011-04-143-0/+162
| | | | | | | | | | | | | | | | | | Add a PatchChangeNotification model to keep track of changes to a patch's state. Hook this up to Patch's pre_save signal. Requires a DB schema upgrade. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * Add email opt-out systemJeremy Kerr2011-04-148-4/+448
| | | | | | | | | | | | | | | | | | | | | | We're going to start generating emails on patchwork updates, so firstly allow people to opt-out of all patchwork communications. We do this with a 'mail settings' interface, allowing non-registered users to set preferences on their email address. Logged-in users can do this through the user profile view. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * registration: use EmailConfimation rather than separate registration appJeremy Kerr2011-04-1411-40/+260
| | | | | | | | | | | | | | | | | | | | Since we have infrastructure for email confirmations, we no longer need the separate registration app. Requires a migration script, which will delete all inactive users, including those newly added and pending confirmation. Use carefully. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * Use generic email confirmation objectJeremy Kerr2011-04-147-29/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | Rather than having a UserPerson-specific confirmation, add an EmailConfirmation object to allow multiple types of confirmations (eg, opt-out requests in future). To do this, we use a view (patchwork.views.confirm) that will call the type-specific view with the confirmation object. Also, add tests to check that the User/Person linkage system works. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* | xmlrpc: do slice before patch_to_dictJeremy Kerr2011-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently, we map patch_to_dict before we slice the results (to only return max_count patches). This means that we hacve to retrieve all patches, then throw away most of the results of the map. This change does the slice on the patches before the map, letting django do a LIMIT-ed query instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* | settings: Use multiple-DB-style format for default settingsJeremy Kerr2011-04-191-6/+6
| | | | | | | | | | | | | | | | | | | | The DATABASE_* settings have been deprecated in django 1.3, replaced by the multiple-database style format (introduced in 1.2, which patchwork requires anyway). This change modifies the default settings.py to use the new format. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* | Order: always set Order.orderJeremy Kerr2011-04-191-2/+1
|/ | | | | | | | | | If we create an Order objecty with editable = True, we don't initialise self.order, leading to testsuite failures with django-1.3. This change always initialises Order.order (and Order.reversed), so we don't exit the constructor without these initalised. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms: Fix MultipleBooleanField.to_python when the field value is missingGuilherme Salgado2011-04-141-2/+2
| | | | | | | | | | | If you write a test for, say, the bundle form of a patch list, you'd still have to specify the 'no change' value to other form (e.g. the multiple update one) fields using MultipleBooleanField or else it'd raise a ValueError when field.clean() is called as part of form._get_errors(). Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: use implied line continuationsJeremy Kerr2011-04-141-9/+8
| | | | | | Use the implied line continuations, and make the indentation more clear. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Project.is_editable to check whether a user has edit rightsGuilherme Salgado2011-04-142-3/+7
| | | | | | | This is to replace the couple of places where we duplicate this same check. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: Refactor generic_list() to make it less complicatedGuilherme Salgado2011-04-143-63/+58
| | | | | | | | | When a form is submitted it now delegates to separate processing functions according to the action. Apart from being more readable it's now a lot easier to add extra forms for processing lists of patches. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* admin: Streamline admin model registrationDirk Wallenstein2011-04-142-21/+11
| | | | | | | | | Use autodiscover and the new way to hook AdminSite into the URLconf. AdminSite.root() will be removed in Django-1.3 as noted here: http://docs.djangoproject.com/en/dev/internals/deprecation/ Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* settings: Remove hard-coded absolute pathsGuilherme Salgado2011-04-142-8/+17
| | | | | | | | This is so that you don't have to change a dozen variables when you deploy an instance somewhere other than on /srv/patchwork. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Remove a bunch of unused variablesGuilherme Salgado2011-03-305-11/+3
| | | | | Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use the 'in' operator instead of dict.has_key(), which has been deprecatedGuilherme Salgado2011-03-302-3/+3
| | | | | Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: Get rid of some code duplication in parsemail-batch.shGuilherme Salgado2011-03-301-8/+2
| | | | | | | | | Change parsemail-bash.sh to uses parsemail.sh (instead of parsemail.py), as the former sets the required environment variables that were being set in parsemail-batch.sh. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: use User.post_save signal to create UserProfile objectsJeremy Kerr2011-03-305-42/+10
| | | | | | | | | | Rather than relying on the registration app's callback mechanism to create the UserProfile object, use the post_save signal on auth.User. This means that the UserProfile will be created regardless of how the User was created. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Replace tab characters with spaces on .py filesGuilherme Salgado2011-03-303-4/+4
| | | | | Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Remove unused importsGuilherme Salgado2011-03-158-38/+12
| | | | | | | | | This is so that we can use static analysis tools like pyflakes to find undefined names (and other common mistakes we often make) without being swamped with unused imports warnings. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: use id__in = get_patch_ids() to get the modified patch setJeremy Kerr2011-03-092-7/+63
| | | | | | | | | | | | Currently, we generic_list processes patches in order of the patch_id:X parameter, which is arbitrarily decided by the browser. By using id__in, we get patches sorted by the default Patch model ordering. This means that the (arbitrary) order of get_patch_ids() doesn't affect the ordering of patches that we process, and bundles are created with a reasonable default patch order. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms: Fix archiving/unarchiving of patches on patch listsGuilherme Salgado2011-03-082-40/+69
| | | | | | | | It was broken because MultipleBooleanField() was leaking string values instead of boolens as expected by MultiplePatchForm. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: Allow pull requests to include a diffGuilherme Salgado2011-03-083-8/+156
| | | | | | | | If a patch comes along with a pull request and a diff, add both to the Patch model. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Remove unused templates and some code for processing themGuilherme Salgado2011-03-082-34/+0
| | | | | | | | These seem to be what was used in the past to archive/unarchive and delete patches. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* filters: quote param names and values when constructing querystringsJeremy Kerr2011-03-083-1/+40
| | | | | | | | | | Use urllib.quote to sanitise parameter names and values; prevents escaped ampersands in the input qs from appearing unescaped in the link output. Add a testcase for the unescaped qs fragments Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Support execution of single testsDirk Wallenstein2011-02-281-14/+5
| | | | | | | | | Django does not use suite() when executing single tests. Importing all tests directly into __init__.py has the same effect as the replaced version of suite(). Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: Recognize mail headers for delegate and stateDirk Wallenstein2011-02-281-1/+24
| | | | | | | | | | | | Introduce two new Patchwork mail headers that determine the initial state and delegate of a patch. They take a state name as displayed in Patchwork and the email address of the wanted delegate. An example: X-Patchwork-State: Changes Requested X-Patchwork-Delegate: maintainer@project.tld Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* admin: Embellish model change listsDirk Wallenstein2011-02-111-7/+26
| | | | | | | | Add fields to the admin change list pages of patchwork models, and add filters and search boxes where appropriate. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/parser: Add test for wrapped git pull requestsJeremy Kerr2011-02-112-2/+355
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: Account for mail client line wrapping in pull requestsDirk Wallenstein2011-02-111-1/+1
| | | | | | | | If a mail client wraps the line with the sha, there won't necessarily be a space after 'commit'. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Don't require optional model fields in formsDirk Wallenstein2011-02-111-6/+6
| | | | | | | | | | | Add blank = True for nullable fields, to allow forms to be subitted without a value for these fields. The keyword 'blank' concerns only validation and does not change what will be stored in the database. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Implement __unicode__ in models instead of __str__Dirk Wallenstein2011-02-111-7/+7
| | | | | | | | | | | | | | | | According to the Django documentation at [1] it is recommended to implement __unicode__ and not __str__. Django's model base class provides a __str__ method that will use the __unicode__ method and convert to utf-8. Also, every text value returned from the DB through the model is unicode. It is now possible to edit Patches and Persons that have values with non-ASCII characters through the admin interface. [1] http://docs.djangoproject.com/en/1.2/ref/unicode/ Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Replace tab in indentation with spaceDirk Wallenstein2011-02-115-20/+20
| | | | | Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* templates: Fix pwclient no-match messagesDirk Wallenstein2011-02-111-2/+2
| | | | | Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/parser: Add subject encoding testsJeremy Kerr2011-02-112-0/+29
| | | | | | | We should now be able to decode internationalised Subject headers, so add tests for this. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: Decode the subject headerDirk Wallenstein2011-02-111-0/+2
| | | | | | | | The clean_header function decodes internationalized headers. Use it for the subject, too. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Revert "Decode patch from UTF-8 while parsing from stdin"Jeremy Kerr2011-02-101-1/+2
| | | | | | | | | This reverts commit 7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e. parse_patch() will never be handed anything but unicode, so no need to do the decode. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Decode patch from UTF-8 while parsing from stdinmartin f. krafft2010-12-131-2/+1
| | | | | | | | | | | | | | Patchwork (rightfully) hashes patches using UTF-8: parser.py: def hash_patch(str): […] hash.update(line.encode('utf-8') + '\n') This patch makes sure that it treats the incoming data as UTF-8 as well. Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: fix handling of UTF-8 char in submitter nameAndreas Bießmann2010-12-101-1/+2
| | | | | | | | | | | | | | | | | | | | This patch fixes following bug in 'list': ---8<--- # pwclient list -p uboot -w andreas.devel | grep New Traceback (most recent call last): File "/Users/andreas/bin/pwclient", line 463, in <module> main() File "/Users/andreas/bin/pwclient", line 411, in main action_list(rpc, filt, submitter_str, delegate_str) File "/Users/andreas/bin/pwclient", line 182, in action_list (person['name'], person['email']) UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 32: ordinal not in range(128) --->8--- Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>