svn.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 13 Jul 2012 22:32:19 +0300
changeset 1334 9bf0d5a1f0cf
parent 899 7b4265c8d324
permissions -rw-r--r--
Include common header with quick links.

-*- mode: outline; coding: utf-8; -*-

* Where palced config files?

The per-user configuration area currently contains three files two
configuration files ('config' and 'servers').

  /etc/subversion
                Unix system wide configurations.
  $HOME/.subversion
                Unix per-user configuration area.
  %APPDATA%\Subversion
                Windows per-user configuration area.


* Copy repo from SourceForge to GoogleCode.

  $ svnsync init https://PROJ.googlecode.com/svn https://PROJ.svn.sourceforge.net/svnroot/PROJ
  $ svnsync --username NAME --password PASSWORD \
                sync https://PROJ.googlecode.com/svn https://PROJ.svn.sourceforge.net/svnroot/PROJ

* Disable interactive conflict resolution.

Write in '$HOME/.subversion/config'

  [miscellany]
  interactive-conflicts = no

* Creating svn repo.

  $ mkdir -p /srv/svn
  $ svnadmin create /srv/svn/$repo
  $ svn co file:///srv/svn/$repo $repo
  $ cd /tmp/$repo
  $ mkdir trunk branches features tags
  $ svn add *
  $ svn st      # check all OK
  $ svn ci -m "Init repo."

For multi-project repo do follow:

  $ mkdir -p /srv/svn
  $ svnadmin create /srv/svn/$repo
  $ svn co file:///srv/svn/$repo $repo
  $ cd /tmp/$repo
  $ for proj in $proj1 $proj2; do mkdir $proj/trunk $proj/branches $proj/features $proj/tags; done
  $ svn add *
  $ svn st      # check all OK
  $ svn ci -m "Init repo."

* Run local svn server.

  $ svnserve.exe -d --pid-file=svnserve.pid --root=/srv/svn/proj  # default port: 3690
  $ svn ls svn://localhost    # check all OK
  $ kill -l

* Undo bad commit.

  $ emacs FILE
...
  $ svn ci -m "Introduce first bug."
Sending        trunk/FILE
Transmitting file data .
Committed revision 7.
  $ emacs FILE
...
  $ svn ci -m "Make a lot of good changes."
...
Committed revision 8.
...
  $ emacs FILE
...
  $ svn ci -m "Introduce second bug."
...
Committed revision 10.
  $ emacs FILE
...
  $ svn ci -m "Make a lot of good changes."
...

Now you understand that revision 7 and 10 buggy. You decide revert changes:

  $ svn merge -r 7:6 -r 10:9 FILE
  $ svn ci -m "Reverted revision 7 and 10."

For one changeset revert you can use shortly syntax:

  $ svn merge -c -7 -c -10 FILE

Also you can use long diapason:

  $ svn merge -r 10:6 FILE