Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/203519/?format=api
{ "id": 203519, "url": "http://patchwork.ozlabs.org/api/patches/203519/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1354581799-775-2-git-send-email-dianders@chromium.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1354581799-775-2-git-send-email-dianders@chromium.org>", "list_archive_url": null, "date": "2012-12-04T00:43:17", "name": "[U-Boot,v2,2/4] patman: Add support for settings in .patman", "commit_ref": "8568baed3bd9b4c0b8d71d1f933cdac459b0eae1", "pull_url": null, "state": "accepted", "archived": false, "hash": "2df05ee193c1bf04c5d4e66f078f1ee79545511c", "submitter": { "id": 9763, "url": "http://patchwork.ozlabs.org/api/people/9763/?format=api", "name": "Douglas Anderson", "email": "dianders@chromium.org" }, "delegate": { "id": 3184, "url": "http://patchwork.ozlabs.org/api/users/3184/?format=api", "username": "sjg", "first_name": "Simon", "last_name": "Glass", "email": "sjg@chromium.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1354581799-775-2-git-send-email-dianders@chromium.org/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/203519/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/203519/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Received": [ "from theia.denx.de (theia.denx.de [85.214.87.163])\n\tby ozlabs.org (Postfix) with ESMTP id 1BAAD2C008F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 4 Dec 2012 11:43:53 +1100 (EST)", "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 7C2114A176;\n\tTue, 4 Dec 2012 01:43:51 +0100 (CET)", "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id wRbX8UlJFvfi; Tue, 4 Dec 2012 01:43:51 +0100 (CET)", "from theia.denx.de (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id E85544A17B;\n\tTue, 4 Dec 2012 01:43:38 +0100 (CET)", "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id A6E464A170\n\tfor <u-boot@lists.denx.de>; Tue, 4 Dec 2012 01:43:32 +0100 (CET)", "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id gsrBoaCfOFRq for <u-boot@lists.denx.de>;\n\tTue, 4 Dec 2012 01:43:28 +0100 (CET)", "from mail-we0-f202.google.com (mail-we0-f202.google.com\n\t[74.125.82.202]) by theia.denx.de (Postfix) with ESMTPS id 654AD4A132\n\tfor <u-boot@lists.denx.de>; Tue, 4 Dec 2012 01:43:26 +0100 (CET)", "by mail-we0-f202.google.com with SMTP id t57so407968wey.3\n\tfor <u-boot@lists.denx.de>; Mon, 03 Dec 2012 16:43:26 -0800 (PST)", "by 10.14.173.136 with SMTP id v8mr12280166eel.2.1354581805134;\n\tMon, 03 Dec 2012 16:43:25 -0800 (PST)", "from hpza10.eem.corp.google.com ([74.125.121.33])\n\tby gmr-mx.google.com with ESMTPS id\n\tz44si115320een.0.2012.12.03.16.43.25\n\t(version=TLSv1/SSLv3 cipher=AES128-SHA);\n\tMon, 03 Dec 2012 16:43:25 -0800 (PST)", "from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com\n\t[172.22.73.80])\n\tby hpza10.eem.corp.google.com (Postfix) with ESMTP id 98310200057;\n\tMon, 3 Dec 2012 16:43:24 -0800 (PST)", "by tictac.mtv.corp.google.com (Postfix, from userid 121310)\n\tid D1C9181151; Mon, 3 Dec 2012 16:43:23 -0800 (PST)" ], "X-Virus-Scanned": [ "Debian amavisd-new at theia.denx.de", "Debian amavisd-new at theia.denx.de" ], "X-policyd-weight": "NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5\n\tNOT_IN_BL_NJABL=-1.5 (only DNSBL check requested)", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=google.com; s=20120113;\n\th=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\n\t:x-gm-message-state;\n\tbh=O3dNSOJS7k+hkbnSI/Fp+BYSW60RBAmcF2vx7YOsbHM=;\n\tb=Y8VUh+H+JbX0OehL+/Qx5hH8/zqiR/qBaywwfWR6Se03z+LPhTlrJG2pNC/cifahiv\n\tWOFRB3lcx9cZmfe4w6BxAGfH2gssnDvgHbIPGMt7EkixW6Jhd5SCVj7+jWIdd65y2dKv\n\t01Tj4N7H2ejd3BFaL5+czink0meFY7iUcIOy08pb38Z7upY9Lb9rYnRi4urnuiOFqlQE\n\t+euL4DcVj/OsY60KmDFKEENePxUSdnuwSswVWXCamqBZBzbbXNvJHBX7tAkr/Rnucgki\n\tozAHUrV8uIDOO6qkYJQctkqsMznTghlF3PU7LpewFbZlvVt9gRNwakl676C6jz7bDWYr\n\tdpQA==", "From": "Doug Anderson <dianders@chromium.org>", "To": "Simon Glass <sjg@chromium.org>", "Date": "Mon, 3 Dec 2012 16:43:17 -0800", "Message-Id": "<1354581799-775-2-git-send-email-dianders@chromium.org>", "X-Mailer": "git-send-email 1.7.7.3", "In-Reply-To": "<1354581799-775-1-git-send-email-dianders@chromium.org>", "References": "<1354321745-1359-1-git-send-email-dianders@chromium.org>\n\t<1354581799-775-1-git-send-email-dianders@chromium.org>", "X-Gm-Message-State": "ALoCoQlHMoPs0PGuu3Ij/VBLkRh2cR2F61gsmFCod9IDquI3Gyx67negwZVMNTHg+mSX6KFKhilWT5l5sJghVTh/ui+vf/InfU42M4B/qPsLXSZuqiVeqYG8qEBbzzpc/HYrnD9JQK/EVGqe3Xoh69c6WePhm2D7fnB0ULge93++UVACixTNqLLczvyuM7mb0JYa0SLbyOj+", "Cc": "u-boot@lists.denx.de", "Subject": "[U-Boot] [PATCH v2 2/4] patman: Add support for settings in .patman", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.11", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<http://lists.denx.de/mailman/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<http://lists.denx.de/mailman/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "u-boot-bounces@lists.denx.de", "Errors-To": "u-boot-bounces@lists.denx.de" }, "content": "This patch adds support for a [settings] section in the .patman file.\nIn this section you can add settings that will affect the default\nvalues for command-line options.\n\nSupport is added in a generic way such that any setting can be updated\nby just referring to the \"dest\" of the option that is passed to the\noption parser. At the moment options that would make sense to put in\nsettings are \"ignore_errors\", \"process_tags\", and \"verbose\". You\ncould override them like:\n\n [settings]\n ignore_errors: True\n process_tags: False\n verbose: True\n\nThe settings functionality is also used in a future change which adds\nsupport for per-project settings.\n\nSigned-off-by: Doug Anderson <dianders@chromium.org>\n---\nChanges in v2: None\n\n tools/patman/README | 16 ++++++++++++++++\n tools/patman/gitutil.py | 2 --\n tools/patman/patman.py | 3 +++\n tools/patman/settings.py | 39 +++++++++++++++++++++++++++++++++++----\n 4 files changed, 54 insertions(+), 6 deletions(-)", "diff": "diff --git a/tools/patman/README b/tools/patman/README\nindex 16b51eb..2743da9 100644\n--- a/tools/patman/README\n+++ b/tools/patman/README\n@@ -98,6 +98,22 @@ The checkpatch.pl in the U-Boot tools/ subdirectory will be located and\n used. Failing that you can put it into your path or ~/bin/checkpatch.pl\n \n \n+If you want to change the defaults for patman's command-line arguments,\n+you can add a [settings] section to your .patman file. This can be used\n+for any command line option by referring to the \"dest\" for the option in\n+patman.py. For reference, the useful ones (at the moment) shown below\n+(all with the non-default setting):\n+\n+>>>\n+\n+[settings]\n+ignore_errors: True\n+process_tags: False\n+verbose: True\n+\n+<<<\n+\n+\n How to run it\n =============\n \ndiff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py\nindex 72d37a0..e7753cf 100644\n--- a/tools/patman/gitutil.py\n+++ b/tools/patman/gitutil.py\n@@ -377,8 +377,6 @@ def GetDefaultUserEmail():\n \n def Setup():\n \"\"\"Set up git utils, by reading the alias files.\"\"\"\n- settings.Setup('')\n-\n # Check for a git alias file also\n alias_fname = GetAliasFile()\n if alias_fname:\ndiff --git a/tools/patman/patman.py b/tools/patman/patman.py\nindex 4181d80..b327c67 100755\n--- a/tools/patman/patman.py\n+++ b/tools/patman/patman.py\n@@ -34,6 +34,7 @@ import checkpatch\n import command\n import gitutil\n import patchstream\n+import settings\n import terminal\n import test\n \n@@ -64,6 +65,8 @@ parser.usage = \"\"\"patman [options]\n Create patches from commits in a branch, check them and email them as\n specified by tags you place in the commits. Use -n to \"\"\"\n \n+\n+settings.Setup(parser, '')\n (options, args) = parser.parse_args()\n \n # Run our meagre tests\ndiff --git a/tools/patman/settings.py b/tools/patman/settings.py\nindex 4dda17b..5208f7d 100644\n--- a/tools/patman/settings.py\n+++ b/tools/patman/settings.py\n@@ -88,13 +88,43 @@ def CreatePatmanConfigFile(config_fname):\n print >>f, \"[alias]\\nme: %s <%s>\" % (name, email)\n f.close();\n \n-def Setup(config_fname=''):\n+def _UpdateDefaults(parser, config):\n+ \"\"\"Update the given OptionParser defaults based on config.\n+\n+ We'll walk through all of the settings from the parser\n+ For each setting we'll look for a default in the option parser.\n+ If it's found we'll update the option parser default.\n+\n+ The idea here is that the .patman file should be able to update\n+ defaults but that command line flags should still have the final\n+ say.\n+\n+ Args:\n+ parser: An instance of an OptionParser whose defaults will be\n+ updated.\n+ config: An instance of SafeConfigParser that we will query\n+ for settings.\n+ \"\"\"\n+ defaults = parser.get_default_values()\n+ for name, val in config.items('settings'):\n+ if hasattr(defaults, name):\n+ default_val = getattr(defaults, name)\n+ if isinstance(default_val, bool):\n+ val = config.getboolean('settings', name)\n+ elif isinstance(default_val, int):\n+ val = config.getint('settings', name)\n+ parser.set_default(name, val)\n+ else:\n+ print \"WARNING: Unknown setting %s\" % name\n+\n+def Setup(parser, config_fname=''):\n \"\"\"Set up the settings module by reading config files.\n \n Args:\n+ parser: The parser to update\n config_fname: Config filename to read ('' for default)\n \"\"\"\n- settings = ConfigParser.SafeConfigParser()\n+ config = ConfigParser.SafeConfigParser()\n if config_fname == '':\n config_fname = '%s/.patman' % os.getenv('HOME')\n \n@@ -102,11 +132,12 @@ def Setup(config_fname=''):\n print \"No config file found ~/.patman\\nCreating one...\\n\"\n CreatePatmanConfigFile(config_fname)\n \n- settings.read(config_fname)\n+ config.read(config_fname)\n \n- for name, value in settings.items('alias'):\n+ for name, value in config.items('alias'):\n alias[name] = value.split(',')\n \n+ _UpdateDefaults(parser, config)\n \n # These are the aliases we understand, indexed by alias. Each member is a list.\n alias = {}\n", "prefixes": [ "U-Boot", "v2", "2/4" ] }