#NEWLINE# def _revision_timestamp_to_local( self , timestamp_str ) : #NEWLINE# #INDENT# 'Convert a timestamp to local time.\n\n        When using a date to ask bzr for a file revision, it expects the date\n        to be in local time. So, this function converts a timestamp from a bzr\n        diff file to local time.\n        ' #NEWLINE# timestamp = datetime ( * time . strptime ( timestamp [ 0 : 19 ] , BZRTool . DIFF_TIMESTAMP_FORMAT ) [ 0 : 6 ] ) #NEWLINE# delta = timedelta ( hours = int ( timestamp_str [ 21 : 23 ] ) , minutes = int ( timestamp_str [ 23 : 25 ] ) ) #NEWLINE# if ( timestamp_str [ 20 ] == '+' ) : #NEWLINE# #INDENT# timestamp -= delta #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# timestamp += delta #NEWLINE# #UNINDENT# return datetime . utcfromtimestamp ( calendar . timegm ( timestamp . timetuple ( ) ) )