The possibility of querying the history of commits applied to a given version of a KB in a GXserver is a very practical resource that is also necessary.
Even when this may be done in a simple manner in GeneXus, with the Team Development option of a local version of the KB connected to GXserver, from the GXserver console, in some cases, it has become necessary to make the query by command line.
An example would be to integrate that information with an external system for the management of incidents/tickets/issues.
There is a utilitarian element called GXServer Client that allows, among other functionalities, the possibility of obtaining the history of commits, fully by command line, without the need for having GeneXus installed.
The result is an xml with the list of commits and all the information relative to each commit (number, comments, date, user, objects involved, type of operation in each object, etc.)
Note: As of GeneXus 15, it is no longer necessary to download the files mentioned below because they are located under the directory corresponding to the installation of GeneXus.
It is at this link, and it comprises these files:
- TeamDev.pdb (debug)
They should be copied onto a local directory, such as C:\GXServerClient, and in a computer with access to GXserver (via http).
When the TeamDev.exe is executed directly, without parameters, it is possible to view all the options available1. In this case, the invocation should be made with the history command. The output is an XML with the list of commits and all the related data.
- Obtaining all commits within a date range:
teamdev history /s:http://localhost/GeneXusServer /kb MyKB /u local\admin /p admin123 /from 2013-08-08T10:30:00 /to 2015-08-08T10:35:00
- Obtaining all the commits whose comments include a number of ticket/issue, such as #TCK00012#:
teamdev history /s:http://localhost/GeneXusServer /kb Pruebas /u local\admin /p admin123 /q:"comment:'#TCK00012#'"
- When the -x parameter is added, it is possible to redirect the output for XML:
teamdev history /s:http://localhost/GeneXusServer /kb Pruebas /u local\admin /p admin123 /q:"comment:'#Tck00012#'" -x > Resultado.xml
It is advisable to use dates in UTC format (there is a parameter to indicate this).
A temporary restriction exists where the teamdev.exe will not function against a GXsever lacking security (user / password)
1 TeamDev.exe options:
Usage: TeamDev.exe [@argfile] <Command> [/ServerUrl|s:<value>] [/ServerUsername|u:<value>] [/ServerPassword|p:<value>][/ServerKbAlias|kb:<value>] [/ServerKbVersion|v:<value>] [/FromDate|from:<value>] [/ToDate|to:<value>] [/XmlOutput|x|xml[+|-]] [/UtcTimes|utc[+|-]] [/RevisionId|r:<value>] [/SearchQuery|q:<value>] [/help|?|h] [/version|v]
@argfile Read arguments from a file.
/ServerUrl:<value> GXserver URL (Default is "")
/ServerUsername:<value> GXserver user name (Default is "")
/ServerPassword:<value> GXserver user password (Default is "")
/ServerKbAlias:<value> GXserver KB alias (Default is "")
/ServerKbVersion:<value> GXserver KB version (Default is "")
/FromDate:<value> Minimum date
/ToDate:<value> Maximum date
/XmlOutput[+|-] Output in XML
/UtcTimes[+|-] Times in UTC
/RevisionId:<value> Revision Id (Default is "0")
/SearchQuery:<value> Search query (Default is "")
/help Show usage.
/version Show version.