(List properties)
% svn proplist main.c
Properties on 'main.c':
svn:keywords
svn:eol-style
(Get properties)
% svn propget svn:keywords main.c
Author Date Id Revision
(Set ignored file list)
% svn propedit svn:ignore .
(Set keywords)
% svn propset svn:keywords 'Author Date Id Revision' main.c
(Set end of line style)
(Note: incompatible with configure scripts generated by autoconf 2.62)
% svn propset svn:eol-style native main.c
(Set executable)
% svn propset svn:executable '*' install-sh
(local)
% svnadmin create --fs-type fsfs /usr/src/svn/project
% svn mkdir file:///usr/src/svn/project/trunk -m ''
% svn mkdir file:///usr/src/svn/project/branches -m ''
% svn mkdir file:///usr/src/svn/project/tags -m ''
(HTTP)
% svn checkout http://svn.icir.org/bro/trunk/bro bro-svn
(SSH)
% svn checkout svn+ssh://fred@nosuch.xyz/usr/src/svn/project/trunk project
(local)
% svn checkout file:///usr/src/svn/project/trunk project
(context)
% svn diff -r70:72 main.c
(straight)
% svn diff --diff-cmd diff --extensions --normal -r70:72 main.c
(whitespace)
% svn diff --diff-cmd diff --extensions '--normal -i' -r70:72 main.c
(whitespace and ignore case)
% svn diff --diff-cmd diff --extensions '--normal -iw' -r70:72 main.c
% svn copy file:///usr/src/svn/project/trunk \
file:///usr/src/svn/project/release-1.3 -m "release-1.3"
(Enable on the repo system)
% cd /usr/src/svn/project/hooks
% cp -pi pre-revprop-change.tmpl pre-revprop-change
% chmod +x pre-revprop-change
(Edit on the repo system)
% svn propedit -r58 --revprop svn:log \
file:///usr/src/svn/project
(Edit from a different host)
% svn propedit -r58 --revprop svn:log \
svn+ssh://fred@nosuch.xyz/usr/src/svn/project
(Don't forward ssh creds, X11 or ports)
ssh = ssh -ax -o clearallforwardings=yes
(Default svn keywords)
*.c = svn:eol-style=native;svn:keywords=Author Date Id Revision
*.h = svn:eol-style=native;svn:keywords=Author Date Id Revision
% svn switch --relocate \
file:///usr/src/svn/apache22-conf \
file:///usr/src/svn/crd-apache22-conf
To find the revisions a file exist in:
% svn log --verbose | grep -A5 -B5 mime.types
The basic strategy is to identify the version you want to resurrect and then use "svn copy".
% svn up
% svn log -v | more
% svn co -r123 \
svn+ssh://fred@nosuch.xyz/usr/src/svn/project/trunk \
/var/tmp/temp-project
% svn copy /var/tmp/temp-project/foo.c foo.c
% svn st
% svn ci foo.c
% svn update
% svn commit
% svn status
% svn info
Note that this method can also be used to copy a file with history from a completely different repo. RCS and CVS to SVN:
Create project-cvs which contains ,v files and an empty CVSROOT directory. The output/target directory (project-svn) must not exist. If there are subdirectories, just make sure to move all the ,v files out of the RCS dirs (and delete the empty RCS dirs) Note: Install cvs2svn and coreutils (gsort) ports.
cvs2svn \
--svnrepos project-svn \
--fs-type fsfs \
--sort=/usr/local/bin/gsort \
project-cvs