<div dir="ltr">Pushed to Release_3.5 and master.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 24, 2020 at 10:48 PM Srikanth Kurapati <<a href="mailto:srikanth.kurapati@multicorewareinc.com">srikanth.kurapati@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">From d3eefd984eb0f2d1b9bb0ab0c0393eeb3e0cf643 Mon Sep 17 00:00:00 2001<br>From: Srikanth Kurapati <<a href="mailto:srikanth.kurapati@multicorewareinc.com" target="_blank">srikanth.kurapati@multicorewareinc.com</a>><br>Date: Wed, 16 Dec 2020 10:52:33 +0530<br>Subject: [PATCH] fix: avoids unnecessary lexicographic order checks on git<br> changesets<br><br>also corrects variables used for git archive version reporting and mandatory fields in version file<br>---<br> source/cmake/Version.cmake | 108 ++++++++++++++++---------------------<br> x265Version.txt | 1 -<br> 2 files changed, 47 insertions(+), 62 deletions(-)<br><br>diff --git a/source/cmake/Version.cmake b/source/cmake/Version.cmake<br>index 37c759268..a3988d39f 100644<br>--- a/source/cmake/Version.cmake<br>+++ b/source/cmake/Version.cmake<br>@@ -28,8 +28,6 @@<br> set(X265_VERSION "unknown")<br> set(X265_LATEST_TAG "0.0")<br> set(X265_TAG_DISTANCE "0")<br>-set(HG_ARCHETYPE "0")<br>-set(GIT_ARCHETYPE "0")<br> <br> #Find version control software to be used for live and extracted repositories from compressed tarballs<br> if(CMAKE_VERSION VERSION_LESS "2.8.10")<br>@@ -43,10 +41,10 @@ else()<br> endif()<br> if(HG_EXECUTABLE)<br> #Set Version Control binary for source code kind<br>- if(EXISTS CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt)<br>+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt)<br> set(HG_ARCHETYPE "1")<br> elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg)<br>- set(HG_ARCHETYPE "2")<br>+ set(HG_ARCHETYPE "0")<br> endif()<br> endif(HG_EXECUTABLE)<br> find_package(Git QUIET) #No restrictions on Git versions used, any versions from 1.8.x to 2.2.x or later should do.<br>@@ -54,14 +52,14 @@ if(Git_FOUND)<br> find_program(GIT_EXECUTABLE git)<br> message(STATUS "GIT_EXECUTABLE ${GIT_EXECUTABLE}")<br> if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)<br>- set(GIT_ARCHETYPE "2")<br>+ set(GIT_ARCHETYPE "0")<br> elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt)<br> set(GIT_ARCHETYPE "1")<br> endif()<br> endif(Git_FOUND)<br>-if(HG_ARCHETYPE STREQUAL "1")<br>+if(HG_ARCHETYPE)<br> #Read the lines of the archive summary file to extract the version<br>- message(STATUS "SOURCE CODE IS FROM x265 ARCHIVED ZIP OR TAR BALL")<br>+ message(STATUS "SOURCE CODE IS FROM x265 HG ARCHIVED ZIP OR TAR BALL")<br> file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt archive)<br> STRING(REGEX REPLACE "\n" ";" archive "${archive}")<br> foreach(f ${archive})<br>@@ -79,7 +77,8 @@ if(HG_ARCHETYPE STREQUAL "1")<br> string(SUBSTRING "${hg_node}" 0 12 X265_REVISION_ID)<br> endif()<br> message(STATUS "HG ARCHIVAL INFORMATION PROCESSED")<br>-elseif(HG_ARCHETYPE STREQUAL "2")<br>+elseif(NOT DEFINED GIT_ARCHETYPE)<br>+# means that's its neither hg archive nor git clone/archive hence it has to be hg live repo as these are only four cases that need to processed in mutual exclusion.<br> execute_process(COMMAND<br> ${HG_EXECUTABLE} log -r. --template "{latesttag}"<br> WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>@@ -107,7 +106,41 @@ elseif(HG_ARCHETYPE STREQUAL "2")<br> string(SUBSTRING ${X265_LATEST_TAG} 1 -1 X265_LATEST_TAG)<br> endif()<br> message(STATUS "HG LIVE REPO STATUS CHECK DONE")<br>-elseif(GIT_ARCHETYPE STREQUAL "2")<br>+elseif(GIT_ARCHETYPE)<br>+ message(STATUS "SOURCE CODE IS FROM x265 GIT ARCHIVED ZIP OR TAR BALL")<br>+ #Read the lines of the archive summary file to extract the version<br>+ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt filebuf)<br>+ STRING(REGEX REPLACE "\n" ";" filebuf "${filebuf}")<br>+ foreach(line ${filebuf})<br>+ string(FIND "${line}" ": " pos)<br>+ string(SUBSTRING "${line}" 0 ${pos} key)<br>+ string(SUBSTRING "${line}" ${pos} -1 value)<br>+ string(SUBSTRING "${value}" 2 -1 value)<br>+ set(git_${key} ${value})<br>+ endforeach()<br>+ if(DEFINED git_releasetag)<br>+ set(X265_LATEST_TAG ${git_releasetag})<br>+ if(DEFINED git_releasetagdistance)<br>+ set(X265_TAG_DISTANCE ${git_releasetagdistance})<br>+ if(X265_TAG_DISTANCE STRGREATER_EQUAL "0")<br>+ #for x265 the repository changeset has to be a tag id or commit id after the tag<br>+ #hence mandating it's presence in version file always for valid tag distances.<br>+ if(DEFINED git_repositorychangeset)<br>+ string(SUBSTRING "${git_repositorychangeset}" 0 9 X265_REVISION_ID)<br>+ else()<br>+ message(WARNING "X265 LATEST COMMIT TIP INFORMATION NOT AVAILABLE")<br>+ endif()<br>+ else()<br>+ message(WARNING "X265 TAG DISTANCE INVALID")<br>+ endif()<br>+ else()<br>+ message(WARNING "COMMIT INFORMATION AFTER LATEST REVISION UNAVAILABLE")<br>+ endif()<br>+ else()<br>+ message(WARNING "X265 RELEASE VERSION LABEL MISSING: ${X265_LATEST_TAG}")<br>+ endif()<br>+ message(STATUS "GIT ARCHIVAL INFORMATION PROCESSED")<br>+else()<br> execute_process(<br> COMMAND<br> ${GIT_EXECUTABLE} describe --abbrev=0 --tags<br>@@ -132,62 +165,15 @@ elseif(GIT_ARCHETYPE STREQUAL "2")<br> ERROR_QUIET<br> OUTPUT_STRIP_TRAILING_WHITESPACE<br> )<br>-elseif(GIT_ARCHETYPE STREQUAL "1")<br>- message(STATUS "X265 GIT ARCHIVE EXTRACT VERSION INFORMATION PROCESSING")<br>- #Read the lines of the archive summary file to extract the version<br>- file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt filebuf)<br>- STRING(REGEX REPLACE "\n" ";" filebuf "${filebuf}")<br>- foreach(line ${filebuf})<br>- string(FIND "${line}" ": " pos)<br>- string(SUBSTRING "${line}" 0 ${pos} key)<br>- string(SUBSTRING "${line}" ${pos} -1 value)<br>- string(SUBSTRING "${value}" 2 -1 value)<br>- set(git_${key} ${value})<br>- endforeach()<br>- if(DEFINED git_releasetag)<br>- set(X265_LATEST_TAG ${git_releasetag})<br>- if(DEFINED git_releasetagcommitid)<br>- string(SUBSTRING "${git_releasetagcommitid}" 0 9 X265_REVISION_ID)<br>- else()<br>- message(WARNING "RELEASE CHANGESET INFO NOT PRESENT IN VERSION FILE")<br>- endif()<br>- if(DEFINED git_repositorychangeset)<br>- string(SUBSTRING "${git_repositorychangeset}" 0 9 X265_REPO_ID)<br>- else()<br>- message(STATUS "X265 LATEST COMMIT TIP INFORMATION NOT AVAILABLE")<br>- endif()<br>- if(DEFINED git_releasetagdistance)<br>- set(X265_TAG_DISTANCE ${git_releasetagdistance})<br>- else()<br>- message(WARNING "COMMIT INFORMATION AFTER LATEST REVISION UNAVAILABLE")<br>- endif()<br>- else()<br>- message(WARNING "X265 RELEASE VERSION LABEL MISSING: ${X265_LATEST_TAG}")<br>- endif()<br>+ message(STATUS "GIT LIVE REPO VERSION RETRIEVED")<br> endif()<br> <br>-# formatting based on positive or negative distance from tag<br>+# formatting based on distance from tag<br> if(X265_TAG_DISTANCE STREQUAL "0")<br>- if(X265_REVISION_ID STREQUAL X265_REPO_ID)<br>- set(X265_VERSION "${X265_LATEST_TAG}")<br>- else()<br>- message(WARNING "REPO AND RELEASE CHANGESETS NOT MATCHING")<br>- endif()<br>+ set(X265_VERSION "${X265_LATEST_TAG}")<br> elseif(X265_TAG_DISTANCE STRGREATER "0")<br>- if(X265_REVISION_ID STRLESS X265_REPO_ID)<br>- set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_REVISION_ID}")<br>- else()<br>- message(WARNING "ARCCHIVE TIP CHANGESET TO BE GREATER THAN REVISION ID")<br>- endif()<br>-elseif(X265_TAG_DISTANCE STRLESS "0")<br>- if(X265_REVISION_ID STRGREATER X265_REPO_ID)<br>- set(X265_VERSION "${X265_LATEST_TAG}${X265_TAG_DISTANCE}+${X265_REPO_ID}")<br>- else()<br>- message(WARNING "REVISION ID EXPECTED TO BE LARGER THAN ARCHIVE TIP CHANGESET")<br>- endif()<br>-else()<br>- message(ERROR "Inappropriate set of version information")<br>+ set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_REVISION_ID}")<br> endif()<br> <br> #will always be printed in its entirety based on version file configuration to avail revision monitoring by repo owners<br>-message(STATUS "x265 RELEASE VERSION ${X265_VERSION}")<br>+message(STATUS "X265 RELEASE VERSION ${X265_VERSION}")<br>diff --git a/x265Version.txt b/x265Version.txt<br>index ac225ec4d..33950f9a0 100644<br>--- a/x265Version.txt<br>+++ b/x265Version.txt<br>@@ -1,5 +1,4 @@<br> #Attribute: Values<br> repositorychangeset: 5163c32d7<br>-releasetagcommitid: a4f320054<br> releasetagdistance: 28<br> releasetag: 3.4<br>-- <br>2.20.1.windows.1<br><br><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><b style="background-color:rgb(255,255,255)"><font color="#0b5394">With Regards,</font></b><div><b style="background-color:rgb(255,255,255)"><font color="#0b5394">Srikanth Kurapati.</font></b></div></div></div></div>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="georgia, serif">Regards,</font><div><b><font face="georgia, serif">Aruna Matheswaran,</font></b></div><div><font face="georgia, serif">Video Codec Engineer,</font></div><div><font face="georgia, serif">Media & AI analytics BU,</font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" width="96" height="36" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><font face="georgia, serif"><br></font></div></div></div></div></div></div></div></div></div>