summaryrefslogtreecommitdiff
path: root/tools/patman/patman.py
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2012-12-03 14:43:18 +0000
committerSimon Glass <sjg@chromium.org>2013-01-31 15:23:40 -0800
commita1dcee84c993232a6c5a1f3b4e54952b587cf1d1 (patch)
tree113b9f92c4430231683587127b244b9abb3fac31 /tools/patman/patman.py
parent8568baed3bd9b4c0b8d71d1f933cdac459b0eae1 (diff)
downloadu-boot-imx-a1dcee84c993232a6c5a1f3b4e54952b587cf1d1.zip
u-boot-imx-a1dcee84c993232a6c5a1f3b4e54952b587cf1d1.tar.gz
u-boot-imx-a1dcee84c993232a6c5a1f3b4e54952b587cf1d1.tar.bz2
patman: Add the concept of multiple projects
There are cases that we want to support different settings (or maybe even different aliases) for different projects. Add support for this by: * Adding detection for two big projects: U-Boot and Linux. * Adding default settings for Linux (U-Boot is already good with the standard patman defaults). * Extend the new "settings" feature in .patman to specify per-project settings. Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/patman.py')
-rwxr-xr-xtools/patman/patman.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index b327c67..2e9e5dc 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -34,6 +34,7 @@ import checkpatch
import command
import gitutil
import patchstream
+import project
import settings
import terminal
import test
@@ -59,6 +60,9 @@ parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',
default=None, help='Output cc list for patch file (used by git)')
parser.add_option('--no-tags', action='store_false', dest='process_tags',
default=True, help="Don't process subject tags as aliaes")
+parser.add_option('-p', '--project', default=project.DetectProject(),
+ help="Project name; affects default option values and "
+ "aliases [default: %default]")
parser.usage = """patman [options]
@@ -66,7 +70,10 @@ Create patches from commits in a branch, check them and email them as
specified by tags you place in the commits. Use -n to """
-settings.Setup(parser, '')
+# Parse options twice: first to get the project and second to handle
+# defaults properly (which depends on project).
+(options, args) = parser.parse_args()
+settings.Setup(parser, options.project, '')
(options, args) = parser.parse_args()
# Run our meagre tests