def get_upated_system(myChangeId, branch_name):
    """
    功能描述:根据changeid_git_list是否与modem_manifest和ap_manifest有交集,判断更新的子模块;
    参数:  myChangeId: changeid,branch_name:分支名
    返回值: ap/gu/tl/x/ci/tool以及用,隔开的组合
    异常描述:
    修改记录:1.日期    : 2014年06月30日
                作者    : l00130025
                修改内容: 创建函数
    """
    # updated_system

    dict = GerritInfo.get_gerrit_info(branch_name, myChangeId)
    myProjects = dict[0]
    myStatus = dict[1]

    if len(myProjects) != 0:

        sub_system = ''

        modem_check_ret = is_in_manifest(
            myProjects, "version_build/Balong_modem_manifest.xml")
        ap_check_ret = is_in_manifest(myProjects,
                                      "version_build/Balong_ap_manifest.xml")
        ci_check_ret = is_in_manifest(myProjects,
                                      "version_build/Balong_ci_manifest.xml")

        if "true" == ap_check_ret:
            sub_system += 'ap,'
        if "true" == modem_check_ret:
            sub_system += 'gu,'
        if "true" == ci_check_ret:
            sub_system += 'ci,'

        if '' == sub_system:
            sub_system = 'ap,gu'
    else:
        sub_system = 'ap,gu'

    return sub_system.strip(',')
def judge_build_target_type(params_dict, myChangeId, branch_name):
    """
    功能描述:根据changeid_git_list是否与stable_rom_manifest有交集,判断轻量级还是重量级编译;
    参数: Gerrit的端口号 gerrit_port; 用户名:gerrit_user; GerretIP:gerrit_ip ; myChangeId: changeid,branch_name:分支名
    返回值: 无
    异常描述:
    修改记录:1.日期    : 2014年01月13日
                作者    : y00187525
                修改内容: 创建函数
    """
    # BUILD_TARGET_PRE_CB_LW:表示pre轻量级编译  BUILD_TARGET_PRE_CB_NLW:表示pre非轻量级编译  BUILD_TARGET_VB_ALL:表示vb编译
    # Temp : add by zhangteng
    return BUILD_TARGET_VB_ALL
    # End
    if string.find(branch_name, '_PRE_COMPILE') == -1:
        build_target = BUILD_TARGET_VB_ALL
    elif params_dict.has_key('lwbuild') and params_dict['lwbuild'] == 'false':
        build_target = BUILD_TARGET_VB_ALL
    else:
        build_target = BUILD_TARGET_PRE_CB_LW
        dict = GerritInfo.get_gerrit_info(branch_name, myChangeId)

        myProjects = dict[0]
        myStatus = dict[1]
        if len(myProjects) == 0:
            build_target = BUILD_TARGET_PRE_CB_NLW
        else:
            #是否需要VB编译
            if "true" == is_merged_version_build(myStatus):
                build_target = BUILD_TARGET_VB_ALL
            else:
                ret = is_in_manifest(
                    myProjects, "version_build/BalongV9R1SFT_nlw_manifest.xml")
                if "true" == ret:
                    build_target = BUILD_TARGET_PRE_CB_NLW

    return build_target
def get_upated_system(myChangeId,branch_name):
    """
    功能描述:根据changeid_git_list是否与modem_manifest和ap_manifest有交集,判断更新的子模块;
    参数:  myChangeId: changeid,branch_name:分支名
    返回值: ap/gu/tl/x/ci/tool以及用,隔开的组合
    异常描述:
    修改记录:1.日期    : 2014年06月30日
                作者    : l00130025
                修改内容: 创建函数
    """
    # updated_system

    dict = GerritInfo.get_gerrit_info(branch_name,myChangeId)
    myProjects = dict[0]
    myStatus = dict[1]
    
    if len(myProjects) != 0:
    
        sub_system=''
        
        modem_check_ret = is_in_manifest(myProjects, "version_build/Balong_modem_manifest.xml")
        ap_check_ret = is_in_manifest(myProjects, "version_build/Balong_ap_manifest.xml")
        ci_check_ret = is_in_manifest(myProjects, "version_build/Balong_ci_manifest.xml")
        
        if "true" == ap_check_ret:
            sub_system+='ap,'
        if "true" == modem_check_ret:
            sub_system+='gu,'                    
        if "true" == ci_check_ret:
            sub_system+='ci,'
            
        if  '' == sub_system  :
            sub_system='ap,gu'             
    else:
        sub_system='ap,gu'
        
    return sub_system.strip(',')
def judge_build_target_type(params_dict,myChangeId,branch_name):
    """
    功能描述:根据changeid_git_list是否与stable_rom_manifest有交集,判断轻量级还是重量级编译;
    参数: Gerrit的端口号 gerrit_port; 用户名:gerrit_user; GerretIP:gerrit_ip ; myChangeId: changeid,branch_name:分支名
    返回值: 无
    异常描述:
    修改记录:1.日期    : 2014年01月13日
                作者    : y00187525
                修改内容: 创建函数
    """
    # BUILD_TARGET_PRE_CB_LW:表示pre轻量级编译  BUILD_TARGET_PRE_CB_NLW:表示pre非轻量级编译  BUILD_TARGET_VB_ALL:表示vb编译    
    # Temp : add by zhangteng
    return BUILD_TARGET_VB_ALL
    # End
    if string.find(branch_name, '_PRE_COMPILE') == -1 :
        build_target = BUILD_TARGET_VB_ALL
    elif params_dict.has_key('lwbuild') and params_dict['lwbuild'] =='false' :
        build_target = BUILD_TARGET_VB_ALL
    else:
        build_target = BUILD_TARGET_PRE_CB_LW
        dict = GerritInfo.get_gerrit_info(branch_name,myChangeId)

        myProjects = dict[0]
        myStatus = dict[1]
        if len(myProjects) == 0:
            build_target = BUILD_TARGET_PRE_CB_NLW
        else:
            #是否需要VB编译
            if "true" == is_merged_version_build(myStatus):
                build_target = BUILD_TARGET_VB_ALL
            else:
                ret = is_in_manifest(myProjects, "version_build/BalongV9R1SFT_nlw_manifest.xml")
                if "true" == ret:
                    build_target = BUILD_TARGET_PRE_CB_NLW
    
    return build_target