#NEWLINE# def get_changes( self ) : #NEWLINE# #INDENT# 'Retrieve file changes for a given revision.\n\n        (wraps ``repos.svn_repos_replay``)\n        ' #NEWLINE# pool = Pool ( self . pool ) #NEWLINE# tmp = Pool ( pool ) #NEWLINE# root = fs . revision_root ( self . fs_ptr , self . rev , pool ( ) ) #NEWLINE# editor = repos . RevisionChangeCollector ( self . fs_ptr , self . rev , pool ( ) ) #NEWLINE# ( e_ptr , e_baton ) = delta . make_editor ( editor , pool ( ) ) #NEWLINE# repos . svn_repos_replay ( root , e_ptr , e_baton , pool ( ) ) #NEWLINE# idx = 0 #NEWLINE# ( copies , deletions ) = ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# changes = [ ] #NEWLINE# revroots = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( path_utf8 , change ) in editor . changes . items ( ) : #NEWLINE# #INDENT# new_path = _from_svn ( path_utf8 ) #NEWLINE# if ( not _is_path_within_scope ( self . scope , new_path ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# path_utf8 = change . path #NEWLINE# base_path_utf8 = change . base_path #NEWLINE# path = _from_svn ( editor ) #NEWLINE# base_path = _from_svn ( base_path_utf8 ) #NEWLINE# base_rev = change . base_rev #NEWLINE# change_action = getattr ( change , 'action' , None ) #NEWLINE# if ( not _is_path_within_scope ( self . scope , base_path ) ) : #NEWLINE# #INDENT# ( base_path , base_rev ) = ( None , ( - 1 ) ) #NEWLINE# #UNINDENT# if ( ( not path ) and ( not new_path ) and ( self . scope == '/' ) ) : #NEWLINE# #INDENT# action = Changeset . EDIT #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not path ) or ( ( change_action is not None ) and ( change_action == repos . CHANGE_ACTION_DELETE ) ) ) : #NEWLINE# #INDENT# if new_path : #NEWLINE# #INDENT# action = Changeset . DELETE #NEWLINE# deletions [ new_path . lstrip ( '/' ) ] = idx #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( change . added or ( not base_path ) ) : #NEWLINE# #INDENT# action = Changeset . ADD #NEWLINE# if ( base_path and base_rev ) : #NEWLINE# #INDENT# action = Changeset . COPY #NEWLINE# copies [ base_path . lstrip ( '/' ) ] = idx #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# action = Changeset . EDIT #NEWLINE# if ( base_rev in revroots ) : #NEWLINE# #INDENT# b_root = revroots [ base_rev ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# b_root = fs . revision_root ( self . fs_ptr , base_rev , pool ( ) ) #NEWLINE# revroots [ base_rev ] = b_root #NEWLINE# #UNINDENT# tmp . clear ( ) #NEWLINE# cbase_path_utf8 = fs . node_created_path ( b_root , base_path_utf8 , tmp ( ) ) #NEWLINE# cbase_path = _from_svn ( cbase_path_utf8 ) #NEWLINE# cbase_rev = fs . node_created_rev ( b_root , base_path_utf8 , tmp ( ) ) #NEWLINE# if _is_path_within_scope ( self . scope , cbase_path ) : #NEWLINE# #INDENT# ( base_path , base_rev ) = ( cbase_path , cbase_rev ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# kind = _kindmap [ change . item_kind ] #NEWLINE# path = _path_within_scope ( self . scope , ( new_path or base_path ) ) #NEWLINE# base_path = _path_within_scope ( self . scope , base_path ) #NEWLINE# changes . append ( [ path , kind , action , base_path , base_rev ] ) #NEWLINE# idx += 1 #NEWLINE# #UNINDENT# moves = [ ] #NEWLINE# for ( k , v ) in copies . items ( ) : #NEWLINE# #INDENT# if ( k in deletions ) : #NEWLINE# #INDENT# changes [ v ] [ 2 ] = Changeset . MOVE #NEWLINE# moves . append ( deletions [ k ] ) #NEWLINE# #UNINDENT# #UNINDENT# offset = 0 #NEWLINE# moves . sort ( ) #NEWLINE# for i in moves : #NEWLINE# #INDENT# del changes [ ( i - offset ) ] #NEWLINE# offset += 1 #NEWLINE# #UNINDENT# changes . sort ( ) #NEWLINE# for change in changes : #NEWLINE# #INDENT# ( yield tuple ( change ) )