remove hash from rev description

This commit is contained in:
Jordan Woyak 2011-08-21 22:46:11 -05:00
parent a910f97c39
commit 6a80b9989a
2 changed files with 8 additions and 2 deletions

View File

@ -13,6 +13,9 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">dummy</Outputs> <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">dummy</Outputs>
</CustomBuild> </CustomBuild>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ClInclude Include="Src\scmrev.h" />
</ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{69F00340-5C3D-449F-9A80-958435C6CF06}</ProjectGuid> <ProjectGuid>{69F00340-5C3D-449F-9A80-958435C6CF06}</ProjectGuid>
<RootNamespace>SVNRevGen</RootNamespace> <RootNamespace>SVNRevGen</RootNamespace>

View File

@ -58,6 +58,9 @@ var describe = GetFirstStdOutLine(gitexe + cmd_describe);
var branch = GetFirstStdOutLine(gitexe + cmd_branch); var branch = GetFirstStdOutLine(gitexe + cmd_branch);
var isMaster = 0 var isMaster = 0
// remove hash from description
describe = describe.replace(/-g\w+/, '');
if (branch == "master") if (branch == "master")
isMaster = 1 isMaster = 1
@ -70,11 +73,11 @@ var out_contents =
// check if file needs updating // check if file needs updating
if (out_contents == GetFileContents(outfile)) if (out_contents == GetFileContents(outfile))
{ {
WScript.Echo(outfile + " current at " + revision); WScript.Echo(outfile + " current at " + describe);
} }
else else
{ {
// needs updating - writeout current info // needs updating - writeout current info
oFS.CreateTextFile(outfile, true).Write(out_contents); oFS.CreateTextFile(outfile, true).Write(out_contents);
WScript.Echo(outfile + " updated to " + revision); WScript.Echo(outfile + " updated to " + describe);
} }