Subtracting 1 from try build count on mailnotifier

This commit is contained in:
Sergio Durigan Junior 2017-09-04 22:00:49 -04:00
parent 8c4345f7e1
commit 68a2361140

View file

@ -445,7 +445,9 @@ send to the gdb-testers mailing list."""
con = sqlite3.connect (db_file)
c = con.cursor ()
c.execute ('SELECT COUNT(*) FROM logs WHERE commitid = "%s" AND branch = "%s" AND trysched = 1' % (sourcestamp.revision, branch))
count = int (c.fetchone ()[0])
# We subtract one here because the "try" has been already stored
# into the db.
count = int (c.fetchone ()[0]) - 1
con.close ()
try_to = build.getReason ().strip ("'try' job by user ")
@ -454,7 +456,7 @@ send to the gdb-testers mailing list."""
istrysched = True, try_to = try_to, try_count = count)
# Subject
subj = "Try Build on %s, branch %s" % (name, branch)
subj = "Try Build #%d on %s, branch %s" % (count, name, branch)
# Body
text = ""