View | Details | Raw Unified | Return to bug 2814
Collapse All | Expand All

(-)a/doc/ns3_html_theme/get_version.sh (-19 / +28 lines)
 Lines 138-165    Link Here 
138
138
139
# Distance from last tag
139
# Distance from last tag
140
# Zero distance means we're at the tag
140
# Zero distance means we're at the tag
141
distance=`hg log -r tip --template '{latesttagdistance}'`
141
if [ -x "$(command -v hg)" ]; then
142
    distance=`hg log -r tip --template '{latesttagdistance}'`
142
143
143
if [ $distance -eq 1 ]; then
144
    if [ $distance -eq 1 ]; then
144
    version=`hg log -r tip --template '{latesttag}'`
145
        version=`hg log -r tip --template '{latesttag}'`
145
    say "at tag $version"
146
        say "at tag $version"
146
147
147
elif [ $tag -eq 1 ]; then
148
    elif [ $tag -eq 1 ]; then
148
    distance=1
149
        distance=1
149
    # version previously set
150
        # version previously set
150
    vers_href=
151
        vers_href=
151
152
153
    else
154
        version=`hg log -r tip --template '{node|short}'`
155
        # Check for uncommitted changes
156
        hg summary | grep 'commit:' | grep -q '(clean)'
157
        if [ ! $? ] ; then
158
	    say "beyond latest tag, last commit: $version, dirty"
159
	    dirty="(+)"
160
        else
161
	    say "beyond latest tag, last commit: $version, clean"
162
	    dirty=
163
        fi
164
    fi
152
else
165
else
153
    version=`hg log -r tip --template '{node|short}'`
166
    version="version-not-found"
154
    # Check for uncommitted changes
167
    say "hg not found; version will not be printed"
155
    hg summary | grep 'commit:' | grep -q '(clean)'
156
    if [ ! $? ] ; then
157
	say "beyond latest tag, last commit: $version, dirty"
158
	dirty="(+)"
159
    else
160
	say "beyond latest tag, last commit: $version, clean"
161
	dirty=
162
    fi
163
fi
168
fi
164
169
165
if [ $PUBLIC -eq 1 ]; then
170
if [ $PUBLIC -eq 1 ]; then
 Lines 191-197    Link Here 
191
    echo "// ns3_version.js:  automatically generated"       >  $outf
196
    echo "// ns3_version.js:  automatically generated"       >  $outf
192
    echo "//  private urls"                                  >> $outf
197
    echo "//  private urls"                                  >> $outf
193
    echo "var ns3_host = \"file://$PWD/\";"                  >  $outf
198
    echo "var ns3_host = \"file://$PWD/\";"                  >  $outf
194
    echo "var ns3_version = \"$repo @ $version$dirty\";"     >> $outf
199
    if [ $version == "version-not-found" ]; then
200
        echo "var ns3_version = \"$repo\";"                  >> $outf
201
    else
202
        echo "var ns3_version = \"$repo @ $version$dirty\";" >> $outf
203
    fi
195
    echo "var ns3_release = \"doc/\";"                       >> $outf
204
    echo "var ns3_release = \"doc/\";"                       >> $outf
196
    echo "var ns3_local = \"build/\";"                       >> $outf
205
    echo "var ns3_local = \"build/\";"                       >> $outf
197
    echo "var ns3_doxy  = \"html/\";"                        >> $outf
206
    echo "var ns3_doxy  = \"html/\";"                        >> $outf

Return to bug 2814