svn.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 05 Aug 2015 23:55:34 +0300
changeset 1729 22ffd80639c0
parent 1531 330085d06687
child 1777 d9b134f80a66
permissions -rw-r--r--
Make centered content design with adoption for mobile devices. Highlight TOC.

.. -*- coding: utf-8; -*-
.. include:: HEADER.rst

=============
 Subversion.
=============
.. contents::

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 -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 ranges::

  $ svn merge -r 10:6 FILE

Merge branches.
===============
::

  $ cd trunk
  $ svn mergeinfo --show-revs eligible ^/branches/feature
  $ svn merge ^/branches/feature
  $ svn ci -m 'Integrate feature X.'