summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d49c9ad)
raw | patch | inline | side by side (parent: d49c9ad)
author | JazzyNico <nicoduf@yahoo.fr> | |
Mon, 8 Mar 2010 19:03:38 +0000 (20:03 +0100) | ||
committer | JazzyNico <nicoduf@yahoo.fr> | |
Mon, 8 Mar 2010 19:03:38 +0000 (20:03 +0100) |
build.xml | [changed mode: 0644->0755] | patch | blob | history |
buildtool.cpp | [changed mode: 0644->0755] | patch | blob | history |
diff --git a/build.xml b/build.xml
--- a/build.xml
+++ b/build.xml
<!--makefile file="${src}/inkscape-version.cpp">
namespace Inkscape {
- char const *version_string = "${version} ${svn.revision}";
+ char const *version_string = "${version}";
}
</makefile-->
<makefile file="${src}/inkscape-version.cpp">
namespace Inkscape {
- char const *version_string = "${version}";
+ char const *version_string = "${version} ${bzr.revision}";
}
</makefile>
<makefile file="config.h">
diff --git a/buildtool.cpp b/buildtool.cpp
--- a/buildtool.cpp
+++ b/buildtool.cpp
/**
* If this prefix is seen in a substitution, use as a
- * Subversion "svn info" query
- * example: <property subversion="svn"/>
- * ${svn.Revision}
+ * Bazaar "bzr revno" query
+ * example: <property subversion="svn"/> ???
+ * ${bzr.Revision}
*/
- String svnPrefix;
+ String bzrPrefix;
int parselen;
};
+/**
+ * Execute the "bzr revno" command and return the result.
+ * This is a simple, small class.
+ */
+class BzrRevno : public MakeBase
+{
+public:
+ /**
+ * Safe way. Execute "bzr revno" and return the result.
+ * Safe from changes in format.
+ */
+ bool query(String &res)
+ {
+ String cmd = "bzr revno";
+
+ String outString, errString;
+ bool ret = executeCommand(cmd.c_str(), "", outString, errString);
+ if (!ret)
+ {
+ error("error executing '%s': %s", cmd.c_str(), errString.c_str());
+ return false;
+ }
+ res = outString;
+ return true;
+ }
+};
/**
* Execute the "svn info" command and parse the result.
return false;
result = val;
}
- else if (svnPrefix.size() > 0 &&
- varname.compare(0, svnPrefix.size(), svnPrefix) == 0)
+ else if (bzrPrefix.size() > 0 &&
+ varname.compare(0, bzrPrefix.size(), bzrPrefix) == 0)
{
- varname = varname.substr(svnPrefix.size());
+ varname = varname.substr(bzrPrefix.size());
String val;
- SvnInfo svnInfo;
+ //SvnInfo svnInfo;
+ BzrRevno bzrRevno;
if (varname == "revision")
{
- if (!svnInfo.query(varname, val))
+ if (!bzrRevno.query(val))
return "";
result = "r"+val;
- }
- if (!svnInfo.query(varname, val))
+ }
+ /*if (!svnInfo.query(varname, val))
return false;
- result = val;
+ result = val;*/
}
else
{
pcPrefix = "pc.";
pccPrefix = "pcc.";
pclPrefix = "pcl.";
- svnPrefix = "svn.";
+ bzrPrefix = "bzr.";
properties.clear();
for (unsigned int i = 0 ; i < allTasks.size() ; i++)
delete allTasks[i];
{
if (attrVal.find('.') != attrVal.npos)
{
- error("subversion prefix cannot have a '.' in it");
+ error("bzr prefix cannot have a '.' in it");
return false;
}
- svnPrefix = attrVal;
- svnPrefix.push_back('.');
+ bzrPrefix = attrVal;
+ bzrPrefix.push_back('.');
}
}