Add more difference infrastructure
This commit is contained in:
parent
a2a582cd39
commit
c564a70e8d
1 changed files with 43 additions and 3 deletions
|
|
@ -21,6 +21,16 @@ class DifferenceRecord {
|
|||
String comment
|
||||
|
||||
DifferenceRecord() {
|
||||
productname = ""
|
||||
subcomponentname = ""
|
||||
jirakey = ""
|
||||
|
||||
rawdifferencetext = ""
|
||||
sha = ""
|
||||
type = ""
|
||||
mergeinfo = ""
|
||||
jiraticketinfo = []
|
||||
comment = ""
|
||||
}
|
||||
|
||||
def String dump() {
|
||||
|
|
@ -158,9 +168,40 @@ def extractmerges(String line) {
|
|||
}
|
||||
|
||||
def extractjiraticketinfo(String line) {
|
||||
boolean result = true
|
||||
def List jiratickets = []
|
||||
|
||||
return [result, [], line]
|
||||
boolean amatch = false
|
||||
while (!amatch) {
|
||||
line = line.trim()
|
||||
def pattern1 = '^(\w+-\d+)(.*)' //GIS-1234 hmbxr5601-1234
|
||||
def match1 = (line =~ pattern1)
|
||||
if (match1.find()) {
|
||||
jiraticket = match1.group(1)
|
||||
jiratickets.add(jiraticket)
|
||||
line = match1.group(2)
|
||||
amatch = true
|
||||
} else {
|
||||
def pattern2 = '^(\w+\d+)(.*)' //GIS1234 smb1234
|
||||
def match2 = (line =~ pattern2)
|
||||
if (match2.find()) {
|
||||
jiraticket = match2.group(1)
|
||||
jiratickets.add(jiraticket)
|
||||
line = match2.group(2)
|
||||
amatch = true
|
||||
} else {
|
||||
def pattern3 = '^(\w+ \d+)(.*)' //GIS 1234 smb 1234
|
||||
def match3 = (line =~ pattern3)
|
||||
if (match3.find()) {
|
||||
jiraticket = match3.group(1)
|
||||
jiratickets.add(jiraticket)
|
||||
line = match3.group(2)
|
||||
amatch = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean result = jiratickets.size() > 0
|
||||
return [result, jiratickets, line]
|
||||
}
|
||||
|
||||
def extractreverts(String line) {
|
||||
|
|
@ -218,7 +259,6 @@ def DifferenceRecord fillrecord(meta, line) {
|
|||
dr.comment = comment
|
||||
} else {
|
||||
dr.type = "Unticketed"
|
||||
dr.jiraticketinfo = []
|
||||
df.comment = line2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue