#NEWLINE# def projectsDiff( self , manifest ) : #NEWLINE# #INDENT# 'return the projects differences between two manifests.\n\n    The diff will be from self to given manifest.\n\n    ' #NEWLINE# fromProjects = self . paths #NEWLINE# toProjects = manifest . paths #NEWLINE# fromKeys = sorted ( fromProjects . keys ( ) ) #NEWLINE# toKeys = sorted ( toProjects . keys ( ) ) #NEWLINE# diff = { #NEWLINE# #INDENT# 'added' : [ ] , #NEWLINE# 'removed' : [ ] , #NEWLINE# 'changed' : [ ] , #NEWLINE# 'unreachable' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# for proj in fromKeys : #NEWLINE# #INDENT# if ( not ( proj in toKeys ) ) : #NEWLINE# #INDENT# diff [ 'removed' ] . append ( fromProjects [ proj ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fromProj = fromProjects [ proj ] #NEWLINE# toProj = toProjects [ proj ] #NEWLINE# try : #NEWLINE# #INDENT# fromRevId = fromProj . GetCommitRevisionId ( ) #NEWLINE# toRevId = toProj . GetCommitRevisionId ( ) #NEWLINE# #UNINDENT# except ManifestInvalidRevisionError : #NEWLINE# #INDENT# diff [ 'unreachable' ] . append ( ( fromProj , toProj ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( fromRevId != toRevId ) : #NEWLINE# #INDENT# diff [ 'changed' ] . append ( ( fromProj , toProj ) ) #NEWLINE# #UNINDENT# #UNINDENT# toKeys . remove ( proj ) #NEWLINE# #UNINDENT# #UNINDENT# for proj in toKeys : #NEWLINE# #INDENT# diff [ 'added' ] . append ( toProjects [ proj ] ) #NEWLINE# #UNINDENT# return diff