-
What is SVN?
-
What is “branch” , “Tag” and “Trunk” in SVN ?
-
what do you mean by “Synchronizing with Repository” ? How is it different from “Update” ?
-
Difference between Update and Commit ?
-
How to apply a patch in SVN ?
-
What if SVN Update gives Merge Conflicts and you just want your local files to be overriden with the repository versions ?
-
trunk vs branch vs tag in subversion or SVN
-
What is the process to take backuop and restore in SVN?
-
How to setup SVN?
-
How to setup authentication in SVN?
Tag: Subversion
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
Apache Subversion 1.7 has Arrived | What’s new in Subversion 1.7 ?
Apache Subversion 1.7 has Arrived
Subversion 1.7.0 has been officially released today. With the release of Subversion 1.7 comes the release of Subversion Edge 2.1.0. This release of Subversion Edge brings you the server binaries for Subversion 1.7.0 as well as the latest release of Apache httpd. In addition to the inclusion of the Subversion 1.7 server binaries this release of Subversion Edge brings a number of other nice improvements including the addition of a complete 64-bit Windows binary stack. As with all previous Subversion Edge releases you can simply update your existing installation from the Subversion Edge web console. There are no other special considerations, the update mechanism handles all details.
I encourage all users to update their Subversion Edge servers to this release so that you and your users can enjoy the new features brought from this release as well as the improved performance and fixes that comes with Subversion 1.7. Look for updates to your favorite Subversion clients to follow shortly.
Source: http://blogs.collab.net/subversion/2011/10/subversion-1-7-0-released/
How to Examin History in Subversion (SVN)?
Examining History in Subversion
Your Subversion repository is like a time machine. It keeps a record of every change ever committed and allows you to explore this history by examining previous versions of files and directories as well as the metadata that accompanies them.
Several commands can provide you with historical data from the repository:
- svn log
- Shows you broad information: log messages with date and author information attached to revisions and which paths changed in each revision
- svn diff
- Shows line-level details of a particular change
- svn cat
- Retrieves a file as it existed in a particular revision number and displays it on your screen
- svn list
- Displays the files in a directory for any given revision
Basic Work Cycle in Subversion (SVN) – Overview
Basic Work Cycle in Subversion (SVN)
Subversion has numerous features, options, bells, and whistles, but on a day-to-day basis, odds are that you will use only a few of them. In this artile, we’ll run through the most common things that you might find yourself doing with Subversion in the course of a day’s work.
The typical work cycle looks like this:
- Update your working copy.
- svn update
- Make changes.
- svn add
- svn delete
- svn copy
- svn move
- Examine your changes.
- svn status
- svn diff
- Possibly undo some changes.
- svn revert
- Resolve conflicts (merge others’ changes).
- svn update
- svn resolve
- Commit your changes.
- svn commit
Subversion’s Components – SVN Components Overview
Subversion’s Components
Subversion, once installed, has a number of different pieces. The following is a quick overview of what you get. Don’t be alarmed if the brief descriptions leave you scratching your head—plenty more pages in this book are devoted to alleviating that confusion.
- svn
- The command-line client program
- svnversion
- A program for reporting the state (in terms of revisions of the items present) of a working copy
- svnlook
- A tool for directly inspecting a Subversion repository
- svnadmin
- A tool for creating, tweaking, or repairing a Subversion repository
- mod_dav_svn
- A plug-in module for the Apache HTTP Server, used to make your repository available to others over a network
- svnserve
- A custom standalone server program, runnable as a daemon process or invokable by SSH; another way to make your repository available to others over a network.
- svndumpfilter
- A program for filtering Subversion repository dump streams
- svnsync
- A program for incrementally mirroring one repository to another over a network
| SVN | Subversion | SVN pros and Cons| SVN Repository Planning | SVN Repository layout
| SVN | Subversion | SVN pros and Cons| SVN Repository Planning | SVN Repository layout |
Subversion (SVN) Repository Layout
Single Project – One project per repository location
Pros
· Isolated revision numbers
· Isolated codebase
· Isolated security model
Cons
· Isolated codebase
· Multiple Urls to remember
· Multiple locations to maintain
Multi-Project Layout – Several projects in one repository
Pros
· Easy to merge code between projects
· Single url for all projects
· One repository to maintain
Cons
· Revision numbers span across all projects
· Harder to isolate users to appropriate repositories
CollabNet delivers Subversion Edge to ease deployment, administration
When you think of the cloud, Agile application lifecycle management may not be the first thing that comes to mind. CollabNet is hoping to change that with a beta distribution that combines Subversion, Apache and ViewVC with a web-based management interface.
Dubbed CollabNet Subversion Edge, the graphical user interface (GUI) works to simplify installation, administration, use, and governance of the software stack. It does this with a built-in update mechanism that alerts users when new software components are ready to install. Users can then install those updates directly from the browser.
The idea is to make it faster and easier to deploy Subversion servers by reducing administration time. And the promised end result is cost savings, says CollabNet in Brisbane, Calif. The graphical user interface on the open-source software is central to the promise. The interface aims to eliminate admin errors, make management of employee and external partner development teams more secure, and provide operational analytics.
CollabNet CEO Bill Portelli says the new product fits in with the company’s mission to advance the way in which Agile teams develop software. He went on to say that the company listened to the market and worked closely with global talent on the open source project.
“What’s clear is that Subversion installation, administration, security, and governance have historically been command-line-driven, requiring special expertise and up-to-the-minute knowledge,” Portelli says, adding that CollabNet Subversion Edge is a response to that challenge.
A closer look at Subversion Edge
In an effort to make it easier to deploy Subversion servers, CollabNet Subversion Edge includes a certified bundle of all the software components of a fully functioning, Apache-based Subversion stack. This bundle effectively does away with the need to search the web for software versions that work together. Then there’s the administration console that installs, manages, and updates the entire stack.
Beyond the deployment, the web-based user interface also works to streamline common administrative tasks, like creating and managing Subversion repositories, starting and stopping the Subversion server, and monitoring server health. The software automatically rotates and archives the logs, and an integrated auto-update feature lets users know when compatible updates are available for any of the distribution components.
On the security and governance front, CollabNet Subversion Edge offers web-based, role-based access control to manage all of the software’s administration features. It also lets admins manage internal and external user access to the Subversion repositories to bolster governance.
Free downloads of the beta version are available immediately on the CollabNet site. General availability is expected later this summer.
BriefingsDirect contributor Jennifer LeClaire provided editorial assistance and research on this post. She can be reached at http://www.linkedin.com/in/jleclaire and http://www.jenniferleclaire.com.
How to install subversion on Linux?
To install svn in linux and make it fully working , I found it really tough and it has taken my lots of time. I am thankful to Sanjay, who helped me in this and without him it won’t be possible.While installing this you will miss a small thing and you got stuck.But this is not at all tough like open source it’s really very easy.
Why I have choosed this topic to write is that, those who are using it first time will need some time to get full of subversion.
Now the latest version of svn is 1.6.9.
To install svn first you need svn tar file. Which can be downloaded easily from here or you can run these commands (depending on your required version).
wget http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz
wget http://subversion.tigris.org/downloads/subversion_deps-1.6.9.tar.gz (It contains the library required by svn)
This you can download any where, Here I am creating a folder svn inside /usr/local directory.(/usr/local/softwares/svn/).(So it will be easy for me to specify paths and you to understand).
To start the installation process first untar this two file.
tar -xvzf subversion-1.6.9.tar.gz
tar -xvzf subversion_deps-1.6.9.tar.gz (After untar you won’t find any particular folder named subversion_deps-1.6.9. Don’t worry for that it is keeping all the libraries files inside subversion-1.6.9)
Now have to configure it, but before that we have to check whether our system is having all the dependies or not, like APR(Apache Portable Runtime) and APR utility.
If it’s not there then we can get it from here,
apr-1.2.12.tar.gz
apr-util-1.2.12.tar.gz
once downloaded you can start configuring it.
tar -xvzf apr-1.2.12.tar.gz
cd apr-1.2.12
./buildconf
./configure
make
The apr util directory requires apr directory, so we need to specify path for that.
tar -xvzf apr-util-1.2.12.tar.gz
cd apr-util-1.2.12
./buildconf –with-apr=/path to apr directory (/usr/local/sofwares/svn/apr-1.2.12)
./configure –with-apr=/path to apr directory (/usr/local/sofwares/svn/apr-1.2.12)
make
The other directories we have to check before installation are,
autoconf 2.50 or newer (autoconf –version)
libtool 1.4 or newer (this you can find inside subversion-1.6.9 folder)
Neon Library 0.25.x or 0.26.x (inside subversion-1.6.9 folder)
Berkely DataBase (If it’s not there you have to install it.)
Download the file, db-4.6.21.tar.gz .
Apache web server greater then 2.0.49 (httpd -version)
zlib (inside subversion-1.6.9 folder)
After checking all this, we can start installation process,
cd subversion-1.6.9
./autogen.sh
./configure –with-berkelay-db=/usr/local/softwares/svn/db-4.6.21 (path of berkelay data base)
make
make install
Once we have finished that we need to map svn with apache.
Before that we have to check whether mod_dav_svn and mod_authz_svn modules are present or not,if not then install it.
yum install mod_dav_svn
and add this in /etc/httpd/conf/httpd.conf file
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Make sure you will add these lines after LoadModule dav_module modules/mod_dav.so.
Now create one repository with svnadmin command.Run this command inside your subversion folder.
svnadmin create repos
after that you can check with,
ls repos
conf dav db format hooks locks README.txt
This full path you have to specify in SVNPath.
Then at the end of the httpd.conf file you have to add
#for svn path
DAV svn
SVNPath /usr/local/softwares/svn/subversion-1.6.9/repos
now restart ur apache.
For security purpose to give authentication to the user we have to create authentication file with the command,
htpasswd -cm /etc/svn-auth-file user_name (test)
New password : test123
Re-Type passwd : test123
And to specify which access you want to give the user, create svn-access-file inside /etc.
Inside this file add code as,
[/]
* = rw
This will give authentication to every user specified in Require user inside location.
You can specify this inside httpd.conf file as,
DAV svn
SVNPath /usr/local/softwares/svn/subversion-1.6.9/repos
AuthzSVNAccessFile /etc/svn-access-file
AuthType Basic
AuthName “Subversion repository”
AuthUserFile /etc/svn-auth-file
Require user user_name
Now you are ready to import files in the repository, with the following command.
svn import -m “Initial import.” path(from where you want to import file) file:///usr/local/softwares/svn/subversion-1.6.9/repos/(repository path)
after running this command don’t worry it is not goin to display any thing inside repos folder. To check that you can run it in the browser.
http://localhost(you have to give your domain name)/svn/repos
Now you are ready to checkout the files with any svn client. For linux user smartsvn is best.
After doin this you can start ur smartsvn client and can follow these steps,
check out project from repository -> manage -> add -> enter svn url
enter ur url here http://localhost/svn/repos
enter ->ok
server name and repository path it will take automatically. click next, choose user radio button and give user name and password.
follow the steps to fetch the files.
To install smartsvn, first get the smartsvn tar file.
untar the file, with the command
tar -xvzf smartsvn-version.gz
for smartsvn first check the correct version of java is available or not, with
java -version command.If it is coming like this then you can proceed.
java version “1.5.0_14?
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Server VM (build 1.5.0_14-b03, mixed mode)
Sometimes java will be installed but not the JRE. In that case simply re-install java.
Can install the latest version of java with rpm bin file.
jdk-1_5_0_14-linux-i586-rpm.bin
./jdk-1_5_0_14-linux-i586-rpm.bin
go through the license and say yes.
It will installed in /usr/java/
Now have to make chnages in .bash_profile file.
cd /root
vi .bash_profile
give JAVA_HOME path.
JAVA_HOME = /usr/java/jdk1.5.0_14
Then compile it with the command,
source .bash_profile
then again check with java version.
Now you are ready to utilise the full feature of subversion
Work on remote Subversion repositories locally with Git
Work on remote Subversion repositories locally with Git
Version control is great stuff, and being able to combine different version control mechanisms is even better. Subversion is a very popular version control system and a lot of repositories (public or otherwise) use Subversion to manage files. Git is another popular one, but what happens if you are working on a project where Subversion is used but Git is your preferred version control system?
With the git-svn plugin, you can have the best of both worlds. You can convert a Subversion repository to Git, use Git tools, then push the changes back to Subversion.
To begin, you will need the git-svn plugin installed. Most likely, if your distribution of choice provides Git, it will also provide git-svn. On Fedora, install it using:
# yum install git-svn
Then use git-svn to check out your Subversion repository into Git format:
% mkdir -p ~/git/code
$ cd ~/git/code
% git svn init http://svn.host.com/svn/code
Initialized empty Git repository in /home/user/git/code/.git/
% git svn fetch
This may take a while on large repositories
r267 = 079b7c1cff49187d1aabc4b16f316102088fdc0d (refs/remotes/git-svn)
W: +empty_dir: trunk
r268 = 3f1944530a092c811c55720bd9322b8c150a535b (refs/remotes/git-svn)
…
r351 = e2af3c12e5ed174d23ffc5917f03a6136f8ebb6b (refs/remotes/git-svn)
Checked out HEAD:
http://svn.host.com/svn/code r351
At this point, the Subversion repository located at http://svn.host.com/svn/code has now been checked out in Git format. On individual files and directories, you can use the git log command as you would the svn log command in order to get history information on the item in question. With git, you will also see the Subversion commit that corresponds to the log entry, for instance:
commit 23f705cd87e1e9c6dd841ca88a14d808e0c4292a
Author: user@HOST.COM
Date: Sat Mar 20 18:25:38 2010 +0000
correct logic on the buildrequires extractor, add stats on BuildRequires to showdbstats output
git-svn-id: http://svn.host.com/svn/code@350 7a5473d1-2304-0410-9229-96f37a904fa4
With the above, you can see that user@HOST.COM did the commit, see the log message, and the Subversion revision (r350).
To work with these files, make changes as normal. git diff works like svn diff does, to see the changes made. To commit changes, use git commit like you would use svn:
% git commit -m “some minor change” file
[master 2454be1] some minor change
1 files changed, 2 insertions(+), 0 deletions(-)
To update your local copy from Subversion, instead of using svn update use git svn rebase. This will merge in any changes found in the Subversion repository.
When committing files using git commit, you are committing your changes to the Git repository. None of these changes are pushed to the Subversion repository until you specifically tell Git to do so. This is done with the git svn dcommit command, which then takes each commit made to Git and pushes them to Subversion as individual commits, which will retain all of your history and log comments:
% git svn dcommit
Committing to http://svn.host.com/svn/code …
M trunk/rqp
Committed r352
M trunk/rqp
r352 = 0557314a580c4390ff646380baa3aa33d1f6a5cd (refs/remotes/git-svn)
No changes between current HEAD and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Unstaged changes after reset:
M trunk/rqp
M trunk/rqp
Committed r353
M trunk/rqp
r353 = 249e97283ad28126bf84ccaffb32873e12d15b7b (refs/remotes/git-svn)
No changes between current HEAD and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
Now, if you were to look at the changed file(s) in Subversion (via another Subversion working copy or something like ViewVC), you will see the individual commits. Above, there were two changes made to the trunk/rqp file, each committed locally to Git. The “dcommit” command pushed those changes as individual commits to the Subversion repository. In this way you can do all local development with Git and when you have something you want to commit to the Subversion repository, you can push all of the relevant changes at once, retaining each separate commit.
Using the git-svn plugin makes it extremely easy to use Git locally with a remote Subversion repository. If you are in a project or organization that, for whatever reason, does not want to convert to Git, you can continue to work with that Subversion repository, without the restriction of using Subversion yourself.
How to Integrate Subversion Into Your Ant Build ? – Step by step guide
SVNAnt
SVNAnt is an Ant task allowing you to interact with Subversion within the convenience of your Ant build script. No more writing custom scripts to get the revision of your repository to tag your release jars. Nor do you have to make command line calls to checkout your latest and greatest as part of your continuous integration process. With SVNAnt, you have the familiarity of the Ant syntax and the flexibility you need for interacting with Subversion.
Features
SVNAnt is a full-featured Subversion client capable of using the native Java bindings or command-line wrappering depending on which is available. Beyond how it works, SVNAnt allows you to do all svn subcommands but the following:
blame | cleanup | help | list |
lock | log | merge | propedit |
proplist | resolved | unlocked |
If the svn subcommand is not listed here, you can use it in your Ant build file. Before we continue start using SVNAnt, we have to install it and configure Ant to use it.
Installation
Now that we know what SVNAnt is and what its features are, lets install SVNAnt so that you can begin to use SVNAnt to access Subversion within your Ant build cycle.
Step 1. (Download, Compile and Extract)
This step will download, compile, and “install” the latest version of SVNAnt.
1.1 Using Subversion, checkout the SVNAnt project located here: http://subclipse.tigris.org/svn/subclipse/trunk/svnant
1.2 From the command line, while inside of the location where you checked out SVNAnt to, run “ant makeDistrib”
1.3 Extract the .zip file created in the build directory of your SVNAnt source to a location of your choosing
Step 2. (Modify your build.xml)
The next step is to tell Ant how to find your SVNAnt task by adding the following to your build.xml file:
<path id= “svnant.classpath” >
<fileset dir= “/PATH/TO/YOUR/EXTRACTED/SVNANT-ZIP” >
<include name= “*.jar” />
</fileset>
</path>
<typedef resource=”org/tigris/subversion/svnant/svnantlib.xml” classpathref=”svnant.classpath” />
That should be it. I know that it appears to be too good to be true so lets verify this.
Step 3. (Verify installation)
Building upon Step 2, lets create a new ant task that will use the wcVersion feature of SVNAnt to get some information about your repository from a local working copy:
<target name=”testSVNAnt”>
<svn>
<wcVersion path= “PATH/TO/YOUR/WORKINGCOPY” />
</svn>
<echo message= “Subversion repository url: ${repository.url}” />
</target>
(Note: In the event that you need to pass credentials to Subversion, look here.)
The output should be something similar to this:
$ ant testSVNAnt
Buildfile: build.xml
testSVNAnt:
[svn] <WcVersion> started …
[svn] finished.
[echo] Subversion repository url: http://svn.apache.org/repos/asf/incubator/openejb/trunk
BUILD SUCCESSFUL
Total time: 43 seconds
Pat yourself on the back. You have successfully installed SVNAnt and you are ready to implement Subversion into your Ant build cycle. Instead of us going through each available feature for SVNAnt, please view the SVNAnt Documentation. Now lets talk about why you may want to use SVNAnt to allow for Subversion interaction inside of your Ant build cycle.