summaryrefslogtreecommitdiffstats
path: root/apps/patchwork
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* models: Fix HeaderParser import on python 2.4Jeremy Kerr2010-11-091-0/+1
| | | | | | | We need to add an import for HeaderParser on python 2.4; email.Parser appears to contain the right stuff. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add support for git-pull requestsJeremy Kerr2010-11-015-6/+394
| | | | | | | | | Add a a pull_url to the Patch object, and update the parser to look for git-pull style emails. Requires SQL migration script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsemail: change tab to spaceJeremy Kerr2010-11-011-1/+1
| | | | | | minor whitespace fix. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: Recognize X-list list headerRalf Baechle2010-09-231-1/+1
| | | | | | Ecartis inserts X-list list headers. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/updates: Add delegate clear testJeremy Kerr2010-09-031-5/+15
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms: change MultiplePatchForm from a ModelForm to a FormJeremy Kerr2010-09-032-22/+28
| | | | | | | | | | | | | ModelForm was causing validation issues, especially with no-change fields on required model fields. Add a test for updating a required field (state) through MultiplePatchForm. Change it to a normal form, and call instance.setattr manually. This makes the new test pass. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/updates: Add multiple invalid state change testJeremy Kerr2010-09-031-5/+18
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/patch: remove unused codeJeremy Kerr2010-09-021-52/+0
| | | | | | | The number of times I've edited this code and wondered why nothing changes... Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms.MultiplePatchForm: remove no-change fields on clean()Jeremy Kerr2010-09-021-0/+15
| | | | | | | | | We need to remove no-change fields, as newer versions of django are checking for proper types on validation. Fixes MultipleUpdateTest. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Add multiple patch update testJeremy Kerr2010-09-023-2/+74
| | | | | | | Add a test for updating mulitple patches. Currently fails with django 1.1. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/user: don't refer to request.POST for non-POST requestsJeremy Kerr2010-08-111-1/+2
| | | | | | | We're ending up wth form errors due to using request.POST, which is empty. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: implement CSRF protectionJeremy Kerr2010-08-101-0/+2
| | | | | | | | | | | Since we've got the csrf token present, we may as well check it for requests. We're using RequestContext already (via PatchworkRequestContext), so we just need to switch it on in the settings, and add an exemption on the xmlrpc interface. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: decode stdin from utf-8Jeremy Kerr2010-08-101-1/+4
| | | | | | | We need to decode stdin from the patch parser as UTF-8, rather than python assuming ascii. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/utils: Specify content encoding on MIMEText() constructionJeremy Kerr2010-08-101-6/+5
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tools: De-hyphenate Git commands in update-patchwork-status.pyMartin Krafft2010-08-101-2/+2
| | | | | | | | Even though update-patchwork-status.py doesn't really do anything yet, it uses the ancient way to call Git commands, so this patch fixes that. Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/bundle/public: Lookup on userJeremy Kerr2010-07-191-1/+2
| | | | | | | | | | | Currently, the public bundle view is only looking up bundles by their name. This may return multiple bundles if two users have bundles with the same name. This change adds the user to the bundle lookup. Reported-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: Use request scheme in sample pwclientrc file.Jeremy Kerr2010-03-191-0/+4
| | | | | | Adapt the pwclientrc file to suit the current scheme in use. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: allow authenticated https connectionsJeremy Kerr2010-03-191-4/+15
| | | | | | | | If the xmlrpc server is using HTTPS, we need to adapt our custom transport to use SafeTransport.make_connection Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Tested-by: Paul Mundt <lethal@linux-sh.org>
* pwclient get: fix for handling messages encoded in UTF-8Paul Menzel2010-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Trying `pwclient get` with a message containing UTF-8 characters you would get the following error. $ python -v pwclient get ID [...] # trying /usr/lib/python2.5/encodings/ascii.so # trying /usr/lib/python2.5/encodings/asciimodule.so # trying /usr/lib/python2.5/encodings/ascii.py # /usr/lib/python2.5/encodings/ascii.pyc matches /usr/lib/python2.5/encodings/ascii.py import encodings.ascii # precompiled from /usr/lib/python2.5/encodings/ascii.pyc Failed to write to subject.patch [...] You can reproduce it with $ pwclient get http://patchwork.openembedded.org/patch/1440/ and the fix is the same as in 4fc6a16910e595401e919abde28cca436193e0dd by Mauro Carvalho Chehab. Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
* pwclient: fallback to patch_get_by_hashJeremy Kerr2009-11-251-1/+7
| | | | | | | | | patch_get_by_project_hash isn't in older xmlrpc interfaces, so fall back to patch_get_by_hash if we see an xmlrpc fault when calling this function. Reported-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Add Reported-By to parsed comment fieldsJeremy Kerr2009-10-231-1/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient,xmlrpc: Specify project for patch hash lookupsJeremy Kerr2009-10-222-3/+13
| | | | | | | | | | | | We may see the same hash for two patches if one is sent to two lists tracked by patchwork. This change adds a new xmlrpc method, patch_get_by_project_hash, which adds the linkname parameter to the lookup. We need to add a new method instead of replacing patch_get_by_hash, to avoid breaking existing pwclient apps. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: Add newline to 'no hash' messageJeremy Kerr2009-10-221-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Copy headers from original mail into patch mbox outputJeremy Kerr2009-09-302-1/+38
| | | | | | | Preserve the Cc and To headers in the mbox output by parsing the saved original headers, and adding them to the mail object. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add Message-Id to xmlrpc patch_get_mbox headersThomas Gleixner2009-09-181-0/+1
| | | | | | | | | | | | While trying to utilize patchwork for my daily workflow I noticed that the xmlrpc patch_get_mbox function does not add the original message id to the headers. That forces me to look it up with the browser which is a major PITA. Add Message-Id to the headers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient fix for handling messages with UTF-8Mauro Carvalho Chehab2009-09-181-1/+1
| | | | | | | | | | | | | | | | | pwclient works fine viewing utf-8 messages, if you don't try to redirect stdout. However, if you do things like pwclient view 5063 >/tmp/patch, it fails due to the weird character handling logic in python: Traceback (most recent call last): File "/usr/local/bin/pwclient", line 446, in ? main() File "/usr/local/bin/pwclient", line 411, in main print s UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 249: ordinal not in range(128) Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: Remove duplicated "name" fieldAbhishek Kulkarni2009-08-151-1/+0
| | | | | | | | Remove duplicated "name" field from the list of allowed fields for a patch list filter in the XML RPC interface. Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: check some edge cases in bundle reordering testsEduardo Habkost2009-08-151-16/+35
| | | | | | | | | | | | | | | | | | While testing BundleReorderTest, I felt like adding more test cases to check if reordering is touching only the right patches on the bundle. This increases the number of patches on the test bundle to 5, and changes the code to do the following tests: - Reorder all patches - Reorder only the first 3 patches - Reorder only the last 3 patches - Reorder only the middle 3 patches - On all above tests, check if the 'order' field on the BundlePatch objects is still consistent Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Fix 'order_start' on BundleReorderTest unit testEduardo Habkost2009-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The 'order_start' parameter on the reorder form should be a patch ID, not the 'order' field of BundlePatch. This fixes the following test failure: > ====================================================================== > FAIL: testBundleReorder (patchwork.tests.bundles.BundleReorderTest) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/mnt/common/code/admin/rh-patchwork/apps/patchwork/tests/bundles.py", line 358, in testBundleReorder > self.failUnlessEqual(response.status_code, 200) > AssertionError: 404 != 200 > > ---------------------------------------------------------------------- > Ran 123 tests in 4.527s > > FAILED (failures=1) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: allow short-form List-Id headersJeremy Kerr2009-08-012-3/+56
| | | | | | | | | | | | | | | | | Some lists (eg, nongnu.org) have short-form List-Id headers. For example: List-Id: qemu-devel.nongnu.org Although RFC 2919 prescribes that: list-id-header = "List-ID:" [phrase] "<" list-id ">" CRLF we should allow for these headers anyway. Based on an original patch from "J.H." <warthog9@kernel.org>. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fix unarchive actionCarl-Daniel Hailfinger2009-07-081-1/+1
| | | | | | We want to un-archive, not re-archive. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add nacked-by tagJeremy Kerr2009-07-082-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: order bundle correctlyJeremy Kerr2009-06-091-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: separate project views into separate fileJeremy Kerr2009-04-053-15/+40
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: test creating bundles with existing namesJeremy Kerr2009-02-271-0/+14
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add extra patch meta tags (Tested/Reviewed/Nacked-by)Mauro Carvalho Chehab2009-02-152-1/+3
| | | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>