#NEWLINE# def parse_commit( parent = None ) : #NEWLINE# #INDENT# cmd = [ 'hg' , 'diff' ] #NEWLINE# if parent : #NEWLINE# #INDENT# cmd . append ( ( '-r "%s"' % ( parent , ) ) ) #NEWLINE# #UNINDENT# proc = Popen ( cmd , stdout = PIPE , stderr = STDOUT ) #NEWLINE# diff = proc . stdout . read ( ) . strip ( ) #NEWLINE# parser = DiffParser ( diff ) #NEWLINE# files = [ ] #NEWLINE# for file in parser . parse ( ) : #NEWLINE# #INDENT# if file [ 'is_header' ] : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( file [ 'new_filename' ] == '/dev/null' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# filename = file [ 'new_filename' ] [ 2 : ] #NEWLINE# is_new = ( file [ 'old_filename' ] == '/dev/null' ) #NEWLINE# files . append ( ChangedFile ( filename , diff ) ) #NEWLINE# #UNINDENT# return files