mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Factor out list_files_to_merge
No behavior changes. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
		
							parent
							
								
									2451ac698d
								
							
						
					
					
						commit
						27a1facd48
					
				@ -260,6 +260,15 @@ def remove_merged_entries(files_to_remove):
 | 
				
			|||||||
    for filename in files_to_remove:
 | 
					    for filename in files_to_remove:
 | 
				
			||||||
        os.remove(filename)
 | 
					        os.remove(filename)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def list_files_to_merge(options):
 | 
				
			||||||
 | 
					    """List the entry files to merge, oldest first.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A file is considered older if it was merged earlier. See
 | 
				
			||||||
 | 
					    `FileMergeTimestamp` for details.
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					    files_to_merge = glob.glob(os.path.join(options.dir, '*.md'))
 | 
				
			||||||
 | 
					    return files_to_merge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def merge_entries(options):
 | 
					def merge_entries(options):
 | 
				
			||||||
    """Merge changelog entries into the changelog file.
 | 
					    """Merge changelog entries into the changelog file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -270,7 +279,7 @@ def merge_entries(options):
 | 
				
			|||||||
    """
 | 
					    """
 | 
				
			||||||
    with open(options.input, 'rb') as input_file:
 | 
					    with open(options.input, 'rb') as input_file:
 | 
				
			||||||
        changelog = ChangeLog(input_file)
 | 
					        changelog = ChangeLog(input_file)
 | 
				
			||||||
    files_to_merge = glob.glob(os.path.join(options.dir, '*.md'))
 | 
					    files_to_merge = list_files_to_merge(options)
 | 
				
			||||||
    if not files_to_merge:
 | 
					    if not files_to_merge:
 | 
				
			||||||
        sys.stderr.write('There are no pending changelog entries.\n')
 | 
					        sys.stderr.write('There are no pending changelog entries.\n')
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user