Den Wed, 09 Jan 2013 21:45:31 +0100 skrev <org.fossil-scm.fossil-us...@io7m.com>:

Hello.

I'm working on a Fossil plugin for Jenkins (http://jenkins-ci.org), and
in order to implement the plugin, I have to query fossil repositories
in various ways.

I'm calling the fossil executables for cloning, pulling, and opening
repositories, but I'm not exactly sure what I should be doing for
queries such as "What version is checked out in the current directory?"
and "Have any commits been made on branch B since this version was
checked out?"

Should I be opening the repositories as SQLite databases and querying
the tables? Is the schema subject to change constantly? For that
matter, should I be parsing the output of the commands? Is the format
of the output subject to unannounced changes?

Personally, I'd rather use SQL than parse text...

Regards,
M
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

I don't know what is the best way to proceed, but I have used the following script to get the current version and the latest version for comparison. Maybe you can draw some ideas from it. It requires the working directory to be an opened fossil check-out.

Example script (snippet):

# Fossil binary
fossil="/bin/fossil"
# sed script for getting the identifier of a check-in
uuid="s/uuid: *\(.*\)$/\1/p"
# Get the current version of the repository
current="$("$fossil" info current | sed -n "$uuid")"
# Get the version of the tip
tip="$("$fossil" info tip | sed -n "$uuid")"

If current and tip are equal, an update should be unnecessary.

Regards,
Sverre
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to