#NEWLINE# def _checkForLaterShadows( self , newLabel , troves ) : #NEWLINE# #INDENT# query = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for trv in troves : #NEWLINE# #INDENT# versionDict = query . setdefault ( trv . getName ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# b = trv . getVersion ( ) . branch ( ) . createShadow ( newLabel ) #NEWLINE# versionDict [ b ] = None #NEWLINE# #UNINDENT# results = self . repos . getTroveLeavesByBranch ( query ) #NEWLINE# if ( not results ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# oldTroves = [ ] #NEWLINE# for trv in troves : #NEWLINE# #INDENT# versionDict = results . get ( trv . getName ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# b = trv . getVersion ( ) . branch ( ) . createShadow ( newLabel ) #NEWLINE# versionList = [ x for x in versionDict if ( ( x . branch ( ) == b ) and ( not x . isModifiedShadow ( ) ) ) ] #NEWLINE# if ( not versionList ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# latestVersion = max ( versionList ) #NEWLINE# oldVersion = latestVersion . parentVersion ( ) #NEWLINE# oldTroves . extend ( ( ( trv . getName ( ) , oldVersion , x ) for x in versionDict [ latestVersion ] ) ) #NEWLINE# #UNINDENT# shadowedTroves = self . repos . getTroves ( oldTroves , withFiles = False ) #NEWLINE# shadowed = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for shadowedTrove in shadowedTroves : #NEWLINE# #INDENT# ( n , v , f ) = shadowedTrove . getNameVersionFlavor ( ) #NEWLINE# shadowed [ ( n , v . branch ( ) , f ) ] = v #NEWLINE# #UNINDENT# laterShadows = [ ] #NEWLINE# for trv in troves : #NEWLINE# #INDENT# ( n , v , f ) = trv . getNameVersionFlavor ( ) #NEWLINE# shadowedVer = shadowed . get ( ( n , v . branch ( ) , f ) , None ) #NEWLINE# if ( not shadowedVer ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( v < shadowedVer ) : #NEWLINE# #INDENT# laterShadows . append ( ( n , v , f , shadowedVer ) ) #NEWLINE# #UNINDENT# #UNINDENT# return laterShadows