Keep Gerrit ACL lines deduplicated
Gerrit ACLs can have multiple duplicate option keys in a section, but completely duplicate lines (key and value together) have no use so make sure they're collapsed into at most 1 copy. Change-Id: I6bf43e860dcc8c3d7b2846d4e058b6c8ac7243eb
This commit is contained in:
parent
ce3ca98ce7
commit
cb63263510
@ -140,8 +140,11 @@ if '7' in transformations:
|
||||
for section in sorted(acl.keys()):
|
||||
if acl[section]:
|
||||
out += '\n[%s]\n' % section
|
||||
lastoption = ''
|
||||
for option in sorted(acl[section], key=tokens):
|
||||
out += '%s\n' % option
|
||||
if option != lastoption:
|
||||
out += '%s\n' % option
|
||||
lastoption = option
|
||||
|
||||
if dry_run:
|
||||
print(out[1:-1])
|
||||
|
Loading…
x
Reference in New Issue
Block a user