<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17950">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">build: Add "basebranch" to .gitreview<br><br>If you have a development branch for a major project that<br>will receive gerrit reviews it'll probably be named something<br>like "development/16/newproject".  That will necessitate setting<br>"defaultbranch=development/16/newproject" in .gitreview.  The<br>make_version script uses that variable to construct the asterisk<br>version however, which results in versions like<br>"GIT-development/16/newproject-ee582a8c7b" which is probably not<br>what you want.  Worse, since the download_externals script uses<br>make_version to construct the URL to download the binary codecs<br>or DPMA.  Since it's expecting a simple numeric version, the<br>downloads will fail.<br><br>To get this to work, a new variable "basebranch" has been added<br>to .gitreview and make_version has been updated to use that instead<br>of defaultversion:<br><br>.gitreview:<br>defaultbranch=development/16/myproject<br>basebranch=16<br><br>Now git-review will send the reviews to the proper branch<br>(development/16/myproject) but the version will still be<br>constructed using the simple branch number (16).<br><br>If "basebranch" is missing from .gitreview, make_version will<br>fall back to using "defaultbranch".<br><br>Change-Id: I2941a3b21e668febeb6cfbc1a7bb51a67726fcc4<br>---<br>M .gitreview<br>M build_tools/make_version<br>2 files changed, 6 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/.gitreview b/.gitreview</span><br><span>index 7db5256..b1e9b41 100644</span><br><span>--- a/.gitreview</span><br><span>+++ b/.gitreview</span><br><span>@@ -1,5 +1,6 @@</span><br><span> [gerrit]</span><br><span> defaultbranch=19</span><br><span style="color: hsl(120, 100%, 40%);">+basebranch=19</span><br><span> #</span><br><span> # Intentional padding to ensure it is possible to point a commit</span><br><span> # to an alternative gerrit server/repository without breaking</span><br><span>diff --git a/build_tools/make_version b/build_tools/make_version</span><br><span>index 83c42d1..6ef7b29 100755</span><br><span>--- a/build_tools/make_version</span><br><span>+++ b/build_tools/make_version</span><br><span>@@ -100,7 +100,11 @@</span><br><span>     MODIFIED=""</span><br><span>     SVN_REV=`${GIT} log --pretty=full -1 | sed -n '/git-svn-id:/ s/.*\@\([^ ]*\) .*/\1/p'`</span><br><span>     if [ -z "$SVN_REV" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">-        MAINLINE_BRANCH=$(git config -f .gitreview --get gerrit.defaultbranch)</span><br><span style="color: hsl(120, 100%, 40%);">+        MAINLINE_BRANCH=$(${GIT} config -f .gitreview --get gerrit.basebranch)</span><br><span style="color: hsl(120, 100%, 40%);">+        if [ "x${MAINLINE_BRANCH}" == "x" ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+            MAINLINE_BRANCH=$(${GIT} config -f .gitreview --get gerrit.defaultbranch)</span><br><span style="color: hsl(120, 100%, 40%);">+        fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`</span><br><span>         if [ $? -ne 0 ]; then</span><br><span>             if [ "`${GIT} ls-files -m | wc -l`" != "0" ]; then</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17950">change 17950</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/17950"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I2941a3b21e668febeb6cfbc1a7bb51a67726fcc4 </div>
<div style="display:none"> Gerrit-Change-Number: 17950 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>