poniedziałek, 23 lutego 2009

Subversion - repository URL of working copy

That tiny script is useful when you've got a few branches and dir names do not reflect those in the repo, eg. branch1, branch2 vs http://oursvnrepo/importantproject/branches/{somefeature,anotherfature} (quite possible in large projects with frequently created branches). Yes, it could be a bit more elegant and discover when the parameter is not a directory, but anyway:
# !/bin/bash
# usage:
# svnpath - SVN repo URL for current dir
# svnpath dirname - svn repo URL for given dir
if [ -z "$1" ]
then
grep '//' .svn/entries | head -n1
else
grep '//' "$1"/.svn/entries | head -n1
fi

Brak komentarzy:

Prześlij komentarz