]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
buildman: Ignore conflicting tags
authorSimon Glass <sjg@chromium.org>
Sat, 6 Sep 2014 01:00:23 +0000 (19:00 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Sep 2014 22:38:31 +0000 (16:38 -0600)
Tags like Series-version are normally expected to appear once, and with a
unique value. But buildman doesn't actually look at these tags. So ignore
conflicts.

This allows bulidman to build a branch containing multiple patman series.

Reported-by: Steve Rae <srae@broadcom.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/control.py
tools/buildman/func_test.py
tools/patman/patchstream.py

index 8146e1caf88aaac6de0b153ca80b656ef24e9506..e97350f9a02d3ee5e411b670106e42ea53c26029 100644 (file)
@@ -166,6 +166,10 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
     # upstream/master~..branch but that isn't possible if upstream/master is
     # a merge commit (it will list all the commits that form part of the
     # merge)
+    # Conflicting tags are not a problem for buildman, since it does not use
+    # them. For example, Series-version is not useful for buildman. On the
+    # other hand conflicting tags will cause an error. So allow later tags
+    # to overwrite earlier ones by setting allow_overwrite=True
     if options.branch:
         if count == -1:
             range_expr = gitutil.GetRangeInBranch(options.git_dir,
@@ -173,19 +177,14 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
             upstream_commit = gitutil.GetUpstream(options.git_dir,
                                                   options.branch)
             series = patchstream.GetMetaDataForList(upstream_commit,
-                options.git_dir, 1)
+                options.git_dir, 1, series=None, allow_overwrite=True)
 
-            # Conflicting tags are not a problem for buildman, since it does
-            # not use them. For example, Series-version is not useful for
-            # buildman. On the other hand conflicting tags will cause an
-            # error. So allow later tags to overwrite earlier ones.
-            series.allow_overwrite = True
             series = patchstream.GetMetaDataForList(range_expr,
-                                              options.git_dir, None, series)
+                    options.git_dir, None, series, allow_overwrite=True)
         else:
             # Honour the count
             series = patchstream.GetMetaDataForList(options.branch,
-                                                    options.git_dir, count)
+                    options.git_dir, count, series=None, allow_overwrite=True)
     else:
         series = None
         options.verbose = True
index c37f1b62081c4d23e6149d810b9e0e819a5c9156..75eb3a97bbee72565951843be91151dc32d43689 100644 (file)
@@ -79,6 +79,7 @@ Date:   Thu Aug 14 16:48:25 2014 -0600
     Series-changes: 7
     - Add new patch to fix the 'reverse' bug
 
+    Series-version: 8
 
     Change-Id: I79078f792e8b390b8a1272a8023537821d45feda
     Reported-by: York Sun <yorksun@freescale.com>
@@ -156,6 +157,8 @@ Date:   Fri Aug 22 15:57:39 2014 -0600
     Series-changes: 9
     - Add new patch to avoid changing the order of tags
 
+    Series-version: 9
+
     Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
     Change-Id: Ib1518588c1a189ad5c3198aae76f8654aed8d0db
 """]
index b3e66c32a95aabb0c38a3746d363f3960d6c437d..d630157f8f70f640858a28d66e0f00b61d74e82a 100644 (file)
@@ -355,7 +355,7 @@ class PatchStream:
 
 
 def GetMetaDataForList(commit_range, git_dir=None, count=None,
-                       series = None):
+                       series = None, allow_overwrite=False):
     """Reads out patch series metadata from the commits
 
     This does a 'git log' on the relevant commits and pulls out the tags we
@@ -367,11 +367,13 @@ def GetMetaDataForList(commit_range, git_dir=None, count=None,
         count: Number of commits to list, or None for no limit
         series: Series object to add information into. By default a new series
             is started.
+        allow_overwrite: Allow tags to overwrite an existing tag
     Returns:
         A Series object containing information about the commits.
     """
     if not series:
         series = Series()
+    series.allow_overwrite = allow_overwrite
     params = gitutil.LogCmd(commit_range,reverse=True, count=count,
                             git_dir=git_dir)
     stdout = command.RunPipe([params], capture=True).stdout