Merge "Update CVS Plugin to use convert_mapping_to_xml"

This commit is contained in:
Jenkins 2016-10-21 11:00:48 +00:00 committed by Gerrit Code Review
commit 818bc3f8ba
1 changed files with 8 additions and 10 deletions

View File

@ -596,16 +596,14 @@ def cvs(registry, xml_parent, data):
raise InvalidAttributeError('compression-level',
compression_level, range(-1, 10))
XML.SubElement(repo_tag, 'compressionLevel').text = compression_level
mapping = [('use-update', 'canUseUpdate', True),
('prune-empty', 'pruneEmptyDirectories', True),
('skip-changelog', 'skipChangeLog', False),
('show-all-output', 'disableCvsQuiet', False),
('clean-checkout', 'cleanOnFailedUpdate', False),
('clean-copy', 'forceCleanCopy', False)]
for elem in mapping:
opt, xml_tag, val = elem[:]
XML.SubElement(cvs, xml_tag).text = str(
data.get(opt, val)).lower()
mappings = [
('use-update', 'canUseUpdate', True),
('prune-empty', 'pruneEmptyDirectories', True),
('skip-changelog', 'skipChangeLog', False),
('show-all-output', 'disableCvsQuiet', False),
('clean-checkout', 'cleanOnFailedUpdate', False),
('clean-copy', 'forceCleanCopy', False)]
convert_mapping_to_xml(cvs, data, mappings, fail_required=True)
def repo(registry, xml_parent, data):