build/buildutils/svnchangeids.py
branchRCL_3
changeset 24 6c158198356e
parent 14 04becd199f91
equal deleted inserted replaced
23:e5618cc85d74 24:6c158198356e
    57         change_id_keyword = "changeid[_-]?" + release + "\s*"
    57         change_id_keyword = "changeid[_-]?" + release + "\s*"
    58     re_rev = re.compile("^r(\d+) \| ", re.I | re.M)
    58     re_rev = re.compile("^r(\d+) \| ", re.I | re.M)
    59     re_change_id = re.compile("(\w+\#\d+)\s*,?", re.I | re.M)
    59     re_change_id = re.compile("(\w+\#\d+)\s*,?", re.I | re.M)
    60     re_change_id_keyword = re.compile(change_id_keyword + "[:=]?\s*(\w+\#\d+)",
    60     re_change_id_keyword = re.compile(change_id_keyword + "[:=]?\s*(\w+\#\d+)",
    61                                       re.I | re.M)
    61                                       re.I | re.M)
       
    62     re_change_id_keyword_only = re.compile(change_id_keyword, re.I | re.M)
    62     svn_change_ids = {}
    63     svn_change_ids = {}
    63     cmd = "svn log -r " + rev_2 + ":" + rev_1 + " " + url
    64     cmd = "svn log -r " + rev_2 + ":" + rev_1 + " " + url
    64     #print cmd
    65     #print cmd
    65     for line in os.popen(cmd).readlines():
    66     for line in os.popen(cmd).readlines():
    66         rev = re_rev.findall(line)
    67         rev = re_rev.findall(line)
    67         if rev:
    68         if rev:
    68             current_rev = rev[0]
    69             current_rev = rev[0]
    69         change_ids = re_change_id_keyword.findall(line)
    70         change_ids = re_change_id_keyword.findall(line)
       
    71         change_id_keywords = re_change_id_keyword_only.findall(line)
       
    72         if len(change_id_keywords) > len(change_ids):
       
    73             print "WARNING: Rev " + current_rev + \
       
    74                 " has more matching changeid keywords" + \
       
    75                 " than matching change ids."
    70         while change_ids:
    76         while change_ids:
    71             for change_id in change_ids:
    77             for change_id in change_ids:
    72                 if change_id in svn_change_ids:
    78                 if change_id in svn_change_ids:
    73                     if not current_rev in svn_change_ids[change_id]:
    79                     if not current_rev in svn_change_ids[change_id]:
    74                         svn_change_ids[change_id] += [current_rev]
    80                         svn_change_ids[change_id] += [current_rev]