Difference between revisions of "Subversion/Using the command line client"

From ReactOS Wiki
Jump to: navigation, search
m
(Add information about creating a diff/patch file)
Line 4: Line 4:
  
 
== Checking out the sources ==
 
== Checking out the sources ==
Retrieve the sources from the repository by executing the following command. Replace <MODULE NAME> with the module you want to check out.
+
Retrieve the sources from the repository by executing the following command. Replace ''MODULE NAME'' with the module you want to check out.
  svn co {{svn-server}}reactos/trunk/<MODULE NAME>
+
  svn co {{svn-server}}reactos/trunk/''MODULE NAME''
  
  
Line 13: Line 13:
  
 
The sources will be put in a directory on your local volume. This directory is called a working copy. Branches are handled in a different way by SVN compared to CVS.
 
The sources will be put in a directory on your local volume. This directory is called a working copy. Branches are handled in a different way by SVN compared to CVS.
To check out a branch use the following command. Replace <BRANCH> with the branch you want to check out.
+
To check out a branch use the following command. Replace ''BRANCH'' with the branch you want to check out.
  svn co {{svn-server}}reactos/branches/<BRANCH>
+
  svn co {{svn-server}}reactos/branches/''BRANCH''
  
 
== Updating the sources ==
 
== Updating the sources ==
Line 21: Line 21:
  
 
This will retrieve changes made to the sources in the repository since your last checkout or update, and put them into your working copy.
 
This will retrieve changes made to the sources in the repository since your last checkout or update, and put them into your working copy.
 +
 +
== Creating a diff/patch file ==
 +
If you made changes to the code, you might want to submit it to the project.
 +
In this case, you should create a diff/patch file, which only contains your changes.
 +
 +
For creating such a file, first jump to the directory, which contains all changed files. Then enter the command:
 +
svn diff > ''PATCHFILE''.patch
 +
 +
Replace ''PATCHFILE'' with the name of your patch file. You should choose a name that describes the purpose of your patch.
  
 
== Committing your changes ==
 
== Committing your changes ==
 
If you have commit (write) access, you can make changes to the repository. You can commit the local changes in your working copy using the following command:
 
If you have commit (write) access, you can make changes to the repository. You can commit the local changes in your working copy using the following command:
  svn ci -m "Commit message" <directory to commit>
+
  svn ci -m "Commit message" ''directory to commit''
  
<directory to commit> is the directory where your local changes are located. This will transfer changes made to your working copy to the repository.
+
''directory to commit'' is the directory where your local changes are located. This will transfer changes made to your working copy to the repository.
  
 
The first time write access is needed, Subversion will ask for an username and password and will use that as default for all future working copies made from the same domain. It is also possible to pass "--username" and "--password" arguments to the Subversion client in order to specify the user account and password.
 
The first time write access is needed, Subversion will ask for an username and password and will use that as default for all future working copies made from the same domain. It is also possible to pass "--username" and "--password" arguments to the Subversion client in order to specify the user account and password.

Revision as of 13:47, 29 October 2007

This page describes the usage of the command line SVN client together with the ReactOS SVN Server.

This client is also bundled with the ReactOS Build Environment for Windows. For other platforms, it is often available as a package.

Checking out the sources

Retrieve the sources from the repository by executing the following command. Replace MODULE NAME with the module you want to check out.

svn co svn://svn.reactos.org/reactos/trunk/MODULE NAME


The following command will check out the ReactOS base components (module reactos):

svn co svn://svn.reactos.org/reactos/trunk/reactos


The sources will be put in a directory on your local volume. This directory is called a working copy. Branches are handled in a different way by SVN compared to CVS. To check out a branch use the following command. Replace BRANCH with the branch you want to check out.

svn co svn://svn.reactos.org/reactos/branches/BRANCH

Updating the sources

You can update your working copy using the following command:

svn up

This will retrieve changes made to the sources in the repository since your last checkout or update, and put them into your working copy.

Creating a diff/patch file

If you made changes to the code, you might want to submit it to the project. In this case, you should create a diff/patch file, which only contains your changes.

For creating such a file, first jump to the directory, which contains all changed files. Then enter the command:

svn diff > PATCHFILE.patch

Replace PATCHFILE with the name of your patch file. You should choose a name that describes the purpose of your patch.

Committing your changes

If you have commit (write) access, you can make changes to the repository. You can commit the local changes in your working copy using the following command:

svn ci -m "Commit message" directory to commit

directory to commit is the directory where your local changes are located. This will transfer changes made to your working copy to the repository.

The first time write access is needed, Subversion will ask for an username and password and will use that as default for all future working copies made from the same domain. It is also possible to pass "--username" and "--password" arguments to the Subversion client in order to specify the user account and password.

More information about SVN commit access can be found here.

Setting a default commit log editor

If you don't want to specify the commit message on the command line, you can set an external editor for it. On Windows, open the text file C:\Documents and Settings\<username>\Application Data\Subversion\config. Put the following two lines in there to set notepad as your default editor:

[helpers] editor-cmd = notepad

More information

  • General information about Subversion in ReactOS is available at the Subversion Wiki page.