Changeset 533 for trunk/email2trac.py.in
- Timestamp:
- 07/28/11 14:24:30 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/email2trac.py.in
r532 r533 1024 1024 self.logger.debug('function ticket_update_by_subject') 1025 1025 1026 matched_id = None1026 found_id = None 1027 1027 if self.parameters.ticket_update and self.parameters.ticket_update_by_subject: 1028 1028 … … 1052 1052 self.logger.debug('Looking for summary matching: "%s"' % summary) 1053 1053 1054 sql = """SELECT id FROM ticket1054 sql = """SELECT id, reporter FROM ticket 1055 1055 WHERE changetime >= %s AND summary LIKE %s 1056 1056 ORDER BY changetime DESC""" 1057 1057 1058 cursor.execute(sql, [lookback, summary.strip()]) 1058 1059 1059 1060 for row in cursor: 1060 (matched_id,) = row 1061 1062 self.logger.debug('Found matching ticket id: %d' % matched_id) 1063 1064 break 1065 1066 if matched_id: 1067 matched_id = '#%d' % matched_id 1068 return (matched_id, orig_subject) 1069 1070 subject = orig_subject 1071 1072 return (matched_id, subject) 1061 1062 (matched_id, sql_reporter) = row 1063 1064 ## Save first entry. 1065 # 1066 if not found_id: 1067 found_id = matched_id 1068 1069 ## If subject and reporter are the same. The we certainly have found the right ticket 1070 # 1071 if sql_reporter == self.author: 1072 self.logger.debug('Found matching reporter: %s with ticket id: %d' %(sql_reporter, matched_id)) 1073 found_id = matched_id 1074 break 1075 1076 if found_id: 1077 self.logger.debug('Found matching ticket id: %d' % found_id) 1078 found_id = '#%d' % found_id 1079 return (found_id, orig_subject) 1080 1081 # obesolete !?? 1082 #subject = orig_subject 1083 1084 return (found_id, subject) 1073 1085 1074 1086
Note: See TracChangeset
for help on using the changeset viewer.