Archive

Archive for the ‘subversion’ Category

Subversion: svn add recursive

January 17, 2013 Leave a comment

The subversion svn add command does not support the recursive option to add several unversioned files.

But you can use this trick from your working copy:


$ svn add --force *

Categories: subversion Tags: , ,

Subversion: modify the comment of a commit

October 5, 2012 Leave a comment

When I forget to comment a subversion commit, or if I want to change it, there is no easy way to edit or modify the commit.

But in the documentation you can find two ways to change it:

http://subversion.apache.org/faq.html#change-log-msg

I use the second one, using svnadmin and the –bypass-hooks option:

$ svnadmin setlog REPOS_PATH -r N FILE

where REPOS_PATH is the path to the repository location, N is the revision number whose log message you wish to change, and FILE is a file containing the new log message.

For instance, to add a comment to a previous revision (13), I type this command:


$ echo "My new comment for this commit (#124)" > log.txt

$ svnadmin setlog ~/svn/myproject/ -r 13 log.txt --bypass-hooks

The (#124) is because I use redmine as project manager. Once added the new comment. I cannot see it at redmine. But that’s easy. Simply delete the repository and add it again to redmine, and you’ll see the content updated.

Categories: redmine, subversion Tags: , , ,

Complete list of SVN status codes

March 29, 2012 Leave a comment

Searching for the ~ svn status code, I found this great post:

http://blog.gotofritz.net/howto/svn-status-codes

Thanks Fritz!

I’ve deleted a directory of my working copy not using svn rm. Just typed svn update to restore it and then svn rm.

Categories: subversion Tags: ,

Subclipse/Subversion error on Ubuntu: Failed to load JavaHL Library

November 25, 2011 4 comments

I’ve installed subclipse and when I restart eclipse and try to share a project, I get this error:

The error is:


Failed to load JavaHL Library.
These are the errors that were encountered:
no libsvnjavahl-1 in java.library.path
no svnjavahl-1 in java.library.path
no svnjavahl in java.library.path
java.library.path = /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/amd64:/app/oracle/product/10.2.0/db_1/Lib:/usr/lib64/xulrunner-addons:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

In most of the cases is due to the lack of the libsvn-java library, so just install it:


$ sudo apt-get install libsvn-java

Now you have to tell eclipse where to find this libraries. First, locate where the is:


$sudo updatedb

$ locate libsvnjavahl-1.so
/usr/lib/jni/libsvnjavahl-1.so
/usr/lib/jni/libsvnjavahl-1.so.0
/usr/lib/jni/libsvnjavahl-1.so.0.0.0

Now, edit PATH_TO_ECLIPSE/eclipse.ini and add this line below -vmargs:


-Djava.library.path=/usr/lib/jni

This is my full eclipse.ini with the line already added:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.0.v20100503
-product
org.eclipse.epp.package.php.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Djava.library.path=/usr/lib/jni
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m

If you still get the error, you’d probably modified the wrong eclipse.ini. In my case, I have a copy of eclipse decompressed in /app folder, but I also have eclipse.ini in /etc, /usr/lib/eclipse and /opt/ibm/lotus/notes/framework/rcp/eclipse/plugins/com.ibm.rcp.base_6.2.2.20100729-1241/linux/x86/. So, be sure to modify the correct eclipse.ini.

To check if you have modified the correct eclipse.ini, you can follow the Linux troubleshooting section at http://subclipse.tigris.org/wiki/JavaHL.

Subversion: is already under version control

I’ve deleted a directory from my repository, and then I created one with the same name. When I issue a commit to subversion from eclipse, I get this error:


'<dir>' is already under version control

It means that an invisible .svn folder already exists with the “old” svn data.
To solve it, just removed the .svn folder and it will work again.

Categories: eclipse, subversion Tags: ,

Localhost: “Falied to open stream”

If you ever find this error in localhost:


Warning: require_once(xajax_core/xajax.inc.php): failed to open stream: Permission denied in /home/mike/eclipse_workspace/web/src/main.php on line 2 Fatal error: require_once(): Failed opening required 'xajax_core/xajax.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/mike/eclipse_workspace/web/src/main.php on line 2

it’s due to a permission error. Today I’ve copied a backup copy from one computer to another and I’ve overwritten the folder’s content.

I resolved it with a chgrp & chmod:


$ chgrp -R www-data application

$ chmod -R 775 application

Subversion – svn: is not a working copy

March 22, 2011 3 comments

I had problems with subversion and now I neither can checkout my project, nor synchronizing it. I always get this error when I try to syncrhonize a folder with my repository:


org.tigris.subversion.javahl.ClientException: svn: '/home/mike/eclipse_workspace/project/src/front' is not a working copy

The problem is that subversion cannot locate the .svn folder, maybe because it has been deleted. To solve this you can:

  • Right click on the folder that is not working and choose Team -> Update to head

And the .svn folder is retrieved from the repo, and now you can synchronize again the files

Categories: eclipse, subversion Tags: , ,