def sMkPrjDevPrjScm(ins): bl = clearcase.getScmBaselineLabel(ins.getNBView(), ins.getWuceProduct()) nextBl = clearcase.getNextScmBaselineLabel(ins.getNBView(), ins.getWuceProduct()) prj = cmbpConfigDir + "/{vobname}_projects/{lb}.prj".format(vobname=ins.getVobFamily(False),lb=bl) nextPrj = cmbpConfigDir + "/{vobname}_projects/{lb}.prj".format(vobname=ins.getVobFamily(False),lb=nextBl) prjlist = [] with open(prj, 'r') as f: prjlist = f.readlines() [prj.replace(bl, nextBl) for prj in prjlist] with open(nextPrj, 'w') as f: f.writelines(prjlist)
def sMergeIntToRelMain(ins): bl = clearcase.getBaselineLabel(ins.getNBView(), ins.getWuceProduct()) mergelog = ins.getDailyDir() + "/{bl}/{bl}.scBRMerge.{vob}".format(bl=bl,vob=ins.getVobFamily()) relview = ins.getName() + "-bmc-rel" if not clearcase.isViewExist(relview): scmbl = clearcase.getScmBaselineLabel(ins.getNBView(), ins.getWuceProduct()) clearcase.mkview(relview, scmbl) cslist = [] with open(clearcase.getViewConfigSpec(ins.getNBView()), "r") as f: cslist = f.readlines() intBr = clearcase.getIntegrationBranch(ins.getNBView(), ins.getWuceProduct()) [cs.replace(intBr, ins.getTargetRelMain()) for cs in cslist] logdir = os.environ['BMC_HOME'] + "/log/{ins}".format(ins=ins.getName()) with open(logdir + "/{lb}.rel.cs".format(lb=nextBl), "w") as f: f.writelines(cslist) clearcase.merge(intBr, relview, ins.getVobFamily(), mergelog)
def sCloseScmBl(): targetScmtBl = clearcase.getScmBaselineLabel(ins.getNBView(),ins.getWuceProduct()) clearcase.ctInView(bmc.config.get('commonView'), "cd {vt}; {cqtool} closebl {targetScmtBl}".format(vt=ins.getVobTag(),cqtool=bmc.config.get('cqtool'),targetScmtBl=targetScmtBl))
def sLinkScmBlC(): targetIntBl = clearcase.getBaselineLabel(ins.getNBView(),ins.getWuceProduct()) targetScmBl = clearcase.getScmBaselineLabel(ins.getNBView(),ins.getWuceProduct()) clearcase.ctInView(bmc.config.get('commonView'), "cd {vt}; {cqtool} linkbl {targetScmBl} -a -child {targetIntBl}".format(vt=ins.getVobTag(),cqtool=bmc.config.get('cqtool'),targetIntBl=targetIntBl, targetScmBl=targetScmBl))
def sLinkScmBlP(): targetScmBl = clearcase.getScmBaselineLabel(ins.getNBView(),ins.getWuceProduct()) preScmBl = clearcase.getPreviousScmBaselineLabel(ins.getNBView(),ins.getWuceProduct()) clearcase.ctInView(bmc.config.get('commonView'), "cd {vt}; {cqtool} linkbl {targetScmBl} -a -predecessor {preScmBl}".format(vt=ins.getVobTag(),cqtool=bmc.config.get('cqtool'),targetScmBl=targetScmBl, preScmBl=preScmBl))
def sLabelRelMain(ins): bl = clearcase.getScmBaselineLabel(ins.getNBView(), ins.getWuceProduct()) lblog = ins.getDailyDir() + "/{bl}/{bl}.mklabel".format(bl=bl) clearcase.mklabel(bl, ins.getVobTag(), ins.getNBView(), lblog)
def sCreateRelLb(ins): bl = clearcase.getScmBaselineLabel(ins.getNBView(), ins.getWuceProduct()) clearcase.mklbtype(bl, ins.getVobTag(), ins.getNBView()) logger.info("created label type {lb}".format(lb=bl))