Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the latest SVN tag

I am setting up a Continuous Integration job that patches an external library and releases the patched version locally.

However, the external library uses TRUNK for development, and I would like my CI job to automatically select the latest release tag for checkout.

Does SVN have that functionality?

(bash Shell Scripts are ok)

like image 729
Sean Patrick Floyd Avatar asked Mar 09 '11 10:03

Sean Patrick Floyd


People also ask

How do I check svn update history?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

What is an svn tag?

A tag is just a “snapshot” of a project in time. In Subversion, this idea already seems to be everywhere. Each repository revision is exactly that—a snapshot of the filesystem after each commit. However, people often want to give more human-friendly names to tags, such as release-1.0 .

Does svn tag?

Subversion does not have special commands for branching or tagging, but uses so-called “cheap copies” instead. Cheap copies are similar to hard links in Unix, which means that instead of making a complete copy in the repository, an internal link is created, pointing to a specific tree/revision.


2 Answers

Hm...What about the following:

svn log URL/tags --limit 1

will print out the last tag.

like image 199
khmarbaise Avatar answered Sep 29 '22 04:09

khmarbaise


This will work if nothing better can be found:

svn log -v <tagsurl> | awk '/^   A/ { print $2 }' | grep -v RC |  head -1

(the grep -v RC part strips release candidates)

Source: this answer to a previous question

like image 34
Sean Patrick Floyd Avatar answered Sep 29 '22 02:09

Sean Patrick Floyd