Skip navigation

Tag Archives: svn

This is how I quickly pull and insert the subversion path within the emacs shell, as I often need the absolute URL when restoring to a file to previous version for example.

(defun svn-root ()
"get path to svn repository"
(interactive)
(insert (shell-command-to-string "svn info | awk -F ':' '/URL/' | cut -c 6- | tr -d '\n'")))

Advertisements

I wanted this so bad …
that is, basically retrieving a file at a particular revision point to the screen. By redirecting it to a file (toView.css, in this case) I can later run the diff-buffer (or diff-files) in emacs to see what was changed.

svn cat -r 3087  t/tmpl/src/css/general.css > general_at_3087.css

Note that prior to that, in order to know what revision point to pull out, I simply ran an svn log command for the file:

svn log -v t/tmpl/src/css/general.css

Another very useful one:
On how to see changes made by specific user:

svn log | sed -n '/username/,/-----$/ p' 

In order to see svn entries in reverse order (from last to older) as this is what I need most of the time. In this case the last 20:

svn -v --limit 20 log

Again using xargs comes in handy to speed up the process of committing a given list of files to the repository.
First let’s preview the command which will save us to type every file name (and their paths)

svn status |   awk '/^M/ {print $2," "}' | xargs echo svn ci -m \"Checking into the repository my last modified files\"

and once it’s been carefully examined, let it run by piping it to bash

svn status |   awk '/^M/{print $2," "}' | xargs echo svn ci -m \"Checking into the repository my last modified files\" | bash