get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/631985/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 631985,
    "url": "http://patchwork.ozlabs.org/api/patches/631985/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/petitboot/patch/20160608062812.14480-6-sam@mendozajonas.com/",
    "project": {
        "id": 53,
        "url": "http://patchwork.ozlabs.org/api/projects/53/?format=api",
        "name": "Petitboot development",
        "link_name": "petitboot",
        "list_id": "petitboot.lists.ozlabs.org",
        "list_email": "petitboot@lists.ozlabs.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20160608062812.14480-6-sam@mendozajonas.com>",
    "list_archive_url": null,
    "date": "2016-06-08T06:28:11",
    "name": "[5/6] ui/ncurses: List available consoles in nc-config",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "7ce0bca7b6bb411f8c8135e1e9edbc41b65fc3dc",
    "submitter": {
        "id": 68013,
        "url": "http://patchwork.ozlabs.org/api/people/68013/?format=api",
        "name": "Sam Mendoza-Jonas",
        "email": "sam@mendozajonas.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/petitboot/patch/20160608062812.14480-6-sam@mendozajonas.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/631985/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/631985/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "petitboot@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "petitboot@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3rPdnB09f2z9sCg\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  8 Jun 2016 16:29:02 +1000 (AEST)",
            "from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3rPdn965kRzDqHH\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  8 Jun 2016 16:29:01 +1000 (AEST)",
            "from mendozajonas.com (mendozajonas.com [188.166.185.233])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3rPdmf6CJ1zDq5v\n\tfor <petitboot@lists.ozlabs.org>;\n\tWed,  8 Jun 2016 16:28:34 +1000 (AEST)",
            "from skellige.ozlabs.ibm.com (unknown [122.99.82.10])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (Client did not present a certificate)\n\t(Authenticated sender: sam@mendozajonas.com)\n\tby mendozajonas.com (Postfix) with ESMTPSA id 221471442E6\n\tfor <petitboot@lists.ozlabs.org>;\n\tWed,  8 Jun 2016 14:28:27 +0800 (SGT)"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=LsE+ZjtX; dkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=LsE+ZjtX; dkim-atps=neutral",
            "lists.ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=mendozajonas.com header.i=@mendozajonas.com\n\theader.b=LsE+ZjtX; dkim-atps=neutral"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com;\n\ts=mail; t=1465367308;\n\tbh=GQvsXfyE9SLK7Spc8xMjpqybyZa7Vu53eYWNG3HD0c0=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=LsE+ZjtXl0BHKWsa9gHzedqQhQd6N0OpTvY2uIgt80b1GSThIlQhHD6xQhpUzgjTr\n\tm6GdwtGL7Sv0/cbqnwRQwuHDDqWAp+XUfv6/ro5AhStHY1EEnuvXavdLaXgjw7Xfso\n\tEiy+U+AZRABfHOBq4BUYHXI2YgVeaDdLWJB0oSjQ=",
        "From": "Samuel Mendoza-Jonas <sam@mendozajonas.com>",
        "To": "petitboot@lists.ozlabs.org",
        "Subject": "[PATCH 5/6] ui/ncurses: List available consoles in nc-config",
        "Date": "Wed,  8 Jun 2016 16:28:11 +1000",
        "Message-Id": "<20160608062812.14480-6-sam@mendozajonas.com>",
        "X-Mailer": "git-send-email 2.8.3",
        "In-Reply-To": "<20160608062812.14480-1-sam@mendozajonas.com>",
        "References": "<20160608062812.14480-1-sam@mendozajonas.com>",
        "X-BeenThere": "petitboot@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.22",
        "Precedence": "list",
        "List-Id": "Petitboot bootloader development <petitboot.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/petitboot>,\n\t<mailto:petitboot-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/petitboot/>",
        "List-Post": "<mailto:petitboot@lists.ozlabs.org>",
        "List-Help": "<mailto:petitboot-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/petitboot>,\n\t<mailto:petitboot-request@lists.ozlabs.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Petitboot\"\n\t<petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "Include a list of available consoles as specified by the discover server\nin nc-config from which the user can select a default. The selected\nconsole specifies the which console to be set as the primary console\nwhen a kernel is kexec'd.\n\nSigned-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>\n---\n ui/ncurses/nc-config.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++---\n 1 file changed, 52 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c\nindex 66ca7a4..724fcae 100644\n--- a/ui/ncurses/nc-config.c\n+++ b/ui/ncurses/nc-config.c\n@@ -33,7 +33,7 @@\n #include \"nc-config.h\"\n #include \"nc-widgets.h\"\n \n-#define N_FIELDS\t39\n+#define N_FIELDS\t42\n \n extern struct help_text config_help_text;\n \n@@ -108,6 +108,9 @@ struct config_screen {\n \n \t\tstruct nc_widget_label\t\t*allow_write_l;\n \t\tstruct nc_widget_select\t\t*allow_write_f;\n+\t\tstruct nc_widget_label\t\t*boot_tty_l;\n+\t\tstruct nc_widget_select\t\t*boot_tty_f;\n+\t\tstruct nc_widget_label\t\t*current_tty_l;\n \n \t\tstruct nc_widget_label\t\t*safe_mode;\n \t\tstruct nc_widget_button\t\t*ok_b;\n@@ -197,7 +200,7 @@ static int screen_process_form(struct config_screen *screen)\n \tchar *str, *end;\n \tstruct config *config;\n \tint i, n_boot_opts, rc, idx;\n-\tunsigned int *order;\n+\tunsigned int *order, tty;\n \tchar mac[20];\n \n \tconfig = config_copy(screen, screen->cui->config);\n@@ -333,6 +336,19 @@ static int screen_process_form(struct config_screen *screen)\n \tif (allow_write != config->allow_writes)\n \t\tconfig->allow_writes = allow_write;\n \n+\tif (config->n_tty) {\n+\t\ttty = widget_select_get_value(screen->widgets.boot_tty_f);\n+\t\tif (!config->boot_tty) {\n+\t\t\tconfig->boot_tty = talloc_strdup(config,\n+\t\t\t\t\t\t\tconfig->tty_list[tty]);\n+\t\t} else if (strncmp(config->boot_tty, config->tty_list[tty],\n+\t\t\t\tstrlen(config->boot_tty)) != 0) {\n+\t\t\ttalloc_free(config->boot_tty);\n+\t\t\tconfig->boot_tty = talloc_strdup(config,\n+\t\t\t\t\t\t\tconfig->tty_list[tty]);\n+\t\t}\n+\t}\n+\n \tconfig->safe_mode = false;\n \trc = cui_send_config(screen->cui, config);\n \ttalloc_free(config);\n@@ -579,6 +595,22 @@ static void config_screen_layout_widgets(struct config_screen *screen)\n \n \ty += 1;\n \n+\tif (widget_height(widget_select_base(screen->widgets.boot_tty_f))) {\n+\t\tlayout_pair(screen, y, screen->widgets.boot_tty_l,\n+\t\t\t    widget_select_base(screen->widgets.boot_tty_f));\n+\t\ty += widget_height(widget_select_base(screen->widgets.boot_tty_f));\n+\t\twidget_move(widget_label_base(screen->widgets.current_tty_l),\n+\t\t\ty, screen->field_x);\n+\t\ty += 2;\n+\t} else {\n+\t\twidget_set_visible(widget_label_base(\n+\t\t\t\t\tscreen->widgets.boot_tty_l), false);\n+\t\twidget_set_visible(widget_select_base(\n+\t\t\t\t\tscreen->widgets.boot_tty_f), false);\n+\t\twidget_set_visible(widget_label_base(\n+\t\t\t\t\tscreen->widgets.current_tty_l), false);\n+\t}\n+\n \twidget_move(widget_button_base(screen->widgets.ok_b),\n \t\t\ty, screen->field_x);\n \twidget_move(widget_button_base(screen->widgets.help_b),\n@@ -740,10 +772,11 @@ static void config_screen_setup_widgets(struct config_screen *screen,\n {\n \tstruct nc_widgetset *set = screen->widgetset;\n \tstruct interface_config *ifcfg;\n-\tchar *str, *ip, *mask, *gw, *url;\n+\tchar *str, *ip, *mask, *gw, *url, *tty;\n \tenum net_conf_type type;\n \tunsigned int i;\n \tint add_len, clear_len, any_len, min_len = 20;\n+\tbool found;\n \n \tbuild_assert(sizeof(screen->widgets) / sizeof(struct widget *)\n \t\t\t== N_FIELDS);\n@@ -986,6 +1019,22 @@ static void config_screen_setup_widgets(struct config_screen *screen,\n \t\t\t\t_(\"Allow bootloader scripts to modify disks\"),\n \t\t\t\tconfig->allow_writes);\n \n+\tscreen->widgets.boot_tty_l = widget_new_label(set, 0, 0,\n+\t\t\t_(\"Default tty:\"));\n+\tscreen->widgets.boot_tty_f = widget_new_select(set, 0, 0,\n+\t\t\t\t\t\tCOLS - screen->field_x - 1);\n+\n+\tfor (i = 0; i < config->n_tty; i++){\n+\t\tfound = strncmp(config->tty_list[i], config->boot_tty,\n+\t\t\t\tstrlen(config->tty_list[i])) == 0;\n+\t\twidget_select_add_option(screen->widgets.boot_tty_f, i,\n+\t\t\t\t\tconfig->tty_list[i], found);\n+\t}\n+\n+\ttty = talloc_asprintf(screen, _(\"Current interface: %s\"),\n+\t\t\t\tttyname(STDIN_FILENO));\n+\tscreen->widgets.current_tty_l = widget_new_label(set, 0 , 0, tty);\n+\n \tscreen->widgets.ok_b = widget_new_button(set, 0, 0, 10, _(\"OK\"),\n \t\t\tok_click, screen);\n \tscreen->widgets.help_b = widget_new_button(set, 0, 0, 10, _(\"Help\"),\n",
    "prefixes": [
        "5/6"
    ]
}