Add a series argument to tag_history_from_git

When importing history for an independant project currently
tag_history_from_git will create the file in
deliverables/UNKNOWN/$project.yaml.  Add a series argument so the file
can be created in the correct directory.

Change-Id: I22c840d1b46624bfdef8add09718c4dc4e489917
This commit is contained in:
Tony Breeds
2017-02-23 10:44:25 -05:00
parent 86f8077fca
commit f0ce5c0ebc

View File

@@ -70,6 +70,8 @@ parser.add_argument('repo', help='repository directory')
parser.add_argument('--release-type', dest='release_type', default='std',
help=('Which release-type to use for this deliverable'
'(Default: %(default)s)'))
parser.add_argument('--series', dest='series',
help=('Which release series to use for this deliverable'))
args = parser.parse_args()
before = os.getcwd()
@@ -86,6 +88,9 @@ tags = [t.strip() for t in tags_out.splitlines() if t.strip()]
repo_namespace = os.path.basename(os.path.dirname(repo))
repo_short_name = repo_namespace + '/' + os.path.basename(repo)
if args.series == 'independent':
args.series = '_independent'
for tag in tags:
if ('-' in tag) or ('rc' in tag) or ('a' in tag) or ('b' in tag):
print('ignoring %r' % tag)
@@ -98,7 +103,7 @@ for tag in tags:
print(tag + ' ' + interesting)
sha, ignore, datestr = interesting.partition(' ')
tag_date = datetime.datetime.utcfromtimestamp(float(datestr))
series_name = date_to_release(tag_date)
series_name = args.series or date_to_release(tag_date)
except subprocess.CalledProcessError:
print('did not find milestone %s tagged for %s' %
(tag, repo_short_name))