parsed.org

Tips by tag: svn

Commands for dealing with branching by cygnus on Jan 12, 2005 12:33 PM

These commands are used to deal with tagging and branching in SVN:

$ cd /path/to/project && svn copy trunk branches/mybranch-N && svn commit -m 'Created new branch'
$ cd /path/to/project/branches/mybranch-N

Make changes and commit:

$ cd /path/to/project/trunk
$ svn merge -r R:head svn://path/to/repo/branches/mybranch-N

(In the merge command, 'R' is the revision in which the branch was created. Note that if the trunk is merged into the branch, then merging the branch back into the trunk again will cause conflicts if selective merging is not used. Use the svn merge -r start:stop syntax for selective merging.)

branchingcommandscommitmergesubversionsvntagging
Context Diff by http://xinu.myopenid.com/ on Apr 29, 2005 02:26 PM

If you want to have a context diff instead of the default that subversion offers, you can give it the binary and options to use on the commandline:

$ svn diff --diff-cmd /usr/bin/diff -x '-crN'
commandscontextdiffsubversionsvn

This URL details the commands necessary to convert a repository from BDB format to FSFS format:

http://svn.haxx.se/users/archive-2005-02/0557.shtml

bdbformatfsfsrepositorysubversionsvn

This is a sample command line for adding an SVN server, but you should be able to re-use these options to create anything you need:

C:\svn\repository>sc create svnserver binpath= "c:\svn\bin\svnserve.exe --service -r c:\svn\repository" displayname= "Subversion" depend= Tcpip start= auto
[SC] CreateService SUCCESS
scservicesvnwindows
Fixing an SVN Log Entry by cygnus on Jan 12, 2005 09:48 AM

If you've botched an SVN log entry (typo, etc.), you can fix it as follows:

$ echo "Here is the new, correct log message" > newlog.txt
$ svnadmin setlog myrepos newlog.txt -r 388
brokencommandslogsubversionsvn
Ignoring Patterns by cygnus on Dec 31, 2005 04:11 PM

Given a directory DIR and a glob of files (e.g. *.php):

$ svn propset svn:ignore \*.php DIR

You can also remove a property:

$ svn propdel svn:ignore DIR

The svn propset format only allows you to set one pattern at a time. To add multiple patterns, run:

$ svn propedit svn:ignore DIR

which opens a file in an editor where you can add ignore patterns, one per line.

commandsignorepropdelpropeditpropertypropsetsubversionsvn
Import New Project by cygnus on Jan 13, 2005 08:29 AM

To create a new project with its own repository, do this. The svnadmin command assumes the path exists already:

$ svnadmin create /path/to/repository
$ svn import project_name file:///path/to/repository -m 'initial checkin'

Then remove the original copy and check it out:

$ mv project_name project_name.old
$ svn checkout file:///path/to/repository/trunk project_name

Note: You can change the file:// to svn:// or whatever protocol you're using.

commandsimportprojectsubversionsvnsvnadmin
Tagging by cygnus on Jan 13, 2005 08:27 AM

Tagging is useful for taking snapshots of releases. For example, in /path/to/project:

$ svn copy trunk tags/release-1.0
$ svn commit -m 'Created release 1.0 tag.'
branchescommandscommitcopysnapshotssubversionsvntagging
RSS