mklog: fix test_mklog.py tests.
contrib/ChangeLog: * mklog.py: Fix broken tests.
This commit is contained in:
parent
88081d38bd
commit
e54da1b6b3
@ -65,13 +65,13 @@ PATCH must be generated using diff(1)'s -up or -cp options
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
script_folder = os.path.realpath(__file__)
|
script_folder = os.path.realpath(__file__)
|
||||||
gcc_root = os.path.dirname(os.path.dirname(script_folder))
|
root = os.path.dirname(os.path.dirname(script_folder))
|
||||||
|
|
||||||
|
|
||||||
def find_changelog(path):
|
def find_changelog(path):
|
||||||
folder = os.path.split(path)[0]
|
folder = os.path.split(path)[0]
|
||||||
while True:
|
while True:
|
||||||
if os.path.exists(os.path.join(args.directory, folder, 'ChangeLog')):
|
if os.path.exists(os.path.join(root, folder, 'ChangeLog')):
|
||||||
return folder
|
return folder
|
||||||
folder = os.path.dirname(folder)
|
folder = os.path.dirname(folder)
|
||||||
if folder == '':
|
if folder == '':
|
||||||
@ -277,7 +277,7 @@ if __name__ == '__main__':
|
|||||||
help='Do not generate function names in ChangeLogs')
|
help='Do not generate function names in ChangeLogs')
|
||||||
parser.add_argument('-p', '--fill-up-bug-titles', action='store_true',
|
parser.add_argument('-p', '--fill-up-bug-titles', action='store_true',
|
||||||
help='Download title of mentioned PRs')
|
help='Download title of mentioned PRs')
|
||||||
parser.add_argument('-d', '--directory', default=gcc_root,
|
parser.add_argument('-d', '--directory',
|
||||||
help='Root directory where to search for ChangeLog '
|
help='Root directory where to search for ChangeLog '
|
||||||
'files')
|
'files')
|
||||||
parser.add_argument('-c', '--changelog',
|
parser.add_argument('-c', '--changelog',
|
||||||
@ -288,6 +288,8 @@ if __name__ == '__main__':
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.input == '-':
|
if args.input == '-':
|
||||||
args.input = None
|
args.input = None
|
||||||
|
if args.directory:
|
||||||
|
root = args.directory
|
||||||
|
|
||||||
data = open(args.input) if args.input else sys.stdin
|
data = open(args.input) if args.input else sys.stdin
|
||||||
if args.update_copyright:
|
if args.update_copyright:
|
||||||
|
Loading…
Reference in New Issue
Block a user