strDiffFileBase = 'loc/client/en_US' strDiffFilePath = strDiffFileBase + '/diff.properties' # Merge files to create the new snapshot MergeUtil.mergeFilesToPath('client/loc', strNewPropsFilePath) # new props file path is not under p4 # Diff print "Including changed/new properties: " if not os.path.exists(strDiffFileBase): os.mkdir(strDiffFileBase) DiffUtil.diffPropsToPath(strOldPropsFilePath, strNewPropsFilePath, strDiffFilePath, True) print # Replace old props snapshot with new props P4File.copyfile(strNewPropsFilePath, strOldPropsFilePath, strChangeDesc) # open our files xmlSources = xml.dom.minidom.parse("bin/loc/loc_sources.xml") strZipPath = os.path.expanduser("~/loc_sources_" + strOutFileExtension + ".zip") zip = zipfile.ZipFile(strZipPath, "w") if nLastUpdateChangeNumber == 0: nLastUpdateChangeNumber = ReadChangeNumber(strLastChangeRecordFilePath, -1) # default last drop is eons ago print "nLastUpdateChangeNumber = ", nLastUpdateChangeNumber # Read list of files to exclude dtExclude = {} for node in xmlSources.getElementsByTagName("exclude"): if node.nodeType == Node.ELEMENT_NODE:
def copyfile(strSrc, strDest): if not os.path.exists(os.path.dirname(strDest)): os.mkdir(os.path.dirname(strDest)) P4File.copyfile(strSrc, strDest, 'dummyloc')