Pagine

Showing posts with label svn. Show all posts
Showing posts with label svn. Show all posts

Friday, 30 June 2017

Comparison of Subversion clients

There are several subversion clients as TortoiseSVN, SmartSVN, RabbitVCS, VisualSVN, AnkhSVN, etc... Choose the better svn client is not easy because it depends from the usage you want to do and the other softwares related.
The goal of this short article is to make a brief overview of some of the clients in circulation highlighting the relevant terms for each of them. 

TortoiseSVN

TortoiseSVN implements a Windows shell extension (linux version is not available), it is easy to use, since it doesn't require the Subversion command line client to run. About the license It is a free tool (GPL).
TortoiseSVN's official web page: https://tortoisesvn.net/

SmartSVN

SmartSVN is a client avaible for OS X, Linux and Windows. It provides a good user interface. About the license, there are two versions: free Foundation edition and as full-featured Professional edition. 
SmartSVN's official web page: http://www.smartsvn.com/

RabbitVCS

RabbitVCS is a set of graphical tools for linux written to provide simple and straightforward access to the version control systems you use. It is not only svn client but even for others source version controls, for example Git. About the licence, it is an other free tool (GPL). You can see some screenshoot in this page.
RabbitVCS's official web page: http://rabbitvcs.org/

VisualSVN

VisualSVN is a professional grade svn integration plug-in for Visual Studio. I think that this plug-in is mandatory if you use svn and Visual Studio.  About the licence, there are more versions also free versions, all details are described in this page. You can see some screenshoot in this page.
VisualSVN's official web page: https://www.visualsvn.com/visualsvn/

AnkhSVN

AnkhSVN is an other Subversion Source Control Provider for Microsoft Visual Studio 2005-2015 and 2017.  About the licence, it is an other free tool but with Apache Licence. You can see some screenshoot in this page.
AnkhSVN's official web page: https://ankhsvn.open.collab.net/

Thursday, 29 June 2017

Eclipse SVN Subclipse vs Subversive plugin

The SVN people have developed a plugin called Subclipse. The Eclipse people have a plugin called Subversive.
Subclipse includes the CollabNet Merge Client originally developed as part of the CollabNet Desktop - Eclipse Edition. The CollabNet Merge Client provides powerful graphical merge capabilities that leverages the merge tracking functionality that was added as part of the Subversion 1.5 release.
Subclipse includes an optional Mylyn connector that enables Mylyn to create automatic changesets based on the tasks you are working on. It also enables links to tasks when viewing history of Subversion commits.
You can see the Subclipse's screenshots in this page.

Instead Subversive have a few convenient features as:

  • Full-Scale SVN Client
  • Seamless Integration with Eclipse
  • Advanced SVN Features
  • Support of the Latest SVN Versions
You can see the Subversive's screenshots in this page.

Functionally the products are very similar as both are mature products.

Monday, 15 May 2017

How to revert a commint with svn

Yuo can revert one a more commits with the following command:
 svn merge -r <current_version>:<target_version> <folder>
After that you can commit the revert.

Example:

 svn merge -r 305:298 .
 svn commit -m "revert..."

Tuesday, 9 May 2017

How to change svn user in TortoiseSVN client (Windows)


TortoiseSVN is a Subversion Client for Windows. After first svn checkout it requires the credentials to be stored. These credential is used for future operations (update, commit, etc...). If you use a second repository but a different svn account, TortoiseSVN uses automatically the credentials already stored and you will probably have an error access (403 forbidden).
The soluntion is the following:
  1. Right click
  2. TortoiseSVN
  3. Settings
  4. Saved Data
  5. Authentication data - Clear
  6. Svn operation (update, commit, etc...)
  7. Put new credentials

Monday, 8 May 2017

Svn Error: E155036 - When it happens

The svn error with code "E155036" is thrown when you use a local copy created before an upgrade of svn server.
A typical scenario is the following:
  1. A developer creates his local copy.
  2. SVN Admin performs the svn server upgrade
  3. After the upgrade, the developer tries to use his local copy and svn throws the error "E155036".
The solution is very easy and it is shown in error description but the focus of this post is on the scenario just described.

> svn status
svn: E155036: Please see the 'svn upgrade' command
svn: E155036: Working copy '/home/user/myproject' is too old (format 10, create
d by Subversion 1.6)
> svn upgrade
Upgraded '.'
Upgraded 'A'
Upgraded 'A/B'
Upgraded 'A/B/C'
.... 

Wednesday, 5 April 2017

SVN tutorial n 33 - propdel

The "svn propdel " command removes the property of one or more items under version control.
The synopsis is:
 svn propdel <prop_name> [<path_target>...]
or
 svn propdel <prop_name> --revprop -r <svn_revision> [<file_target>]
The first form removes versioned properties in your working copy, and the second removes unversioned remote properties on a repository revision (<file_target>).

Example:

I want remove the property used in tutorial n 32.
 svn propdel svn:ignore mydir

Tuesday, 4 April 2017

SVN tutorial n 32 - propedit

The "svn propedit" command, different from "svn propset" amending the value of properties, edits the property of one or more items under version control. The synopsis is:
 svn propedit <prop_name> <file_target>
or
 svn propedit <prop_name> --revprop -r <svn_revision> [<file_target>]

Example: 

I have a cache directory (mydir) that I don't need under source control.
 svn propedit svn:ignore mydir

Thursday, 9 March 2017

SVN tutorial n 31 - propset

The "svn propset" commands sets a property name to a property value on files, directories and/or revisions. The synopsis is:
 svn propset PROPNAME [PROPVAL | -F VALFILE] PATH...
or
 svn propset PROPNAME --revprop -r REV [PROPVAL | -F VALFILE] [TARGET]

Examples:

Set the MIME type for a file:
 svn propset svn:mime-type image/jpeg file.jpg 
 property 'svn:mime-type' set on 'file.jpg'
On a Unix system, if you want a file to have the executable permission set:
 svn propset svn:executable ON myscript.sh
 property 'svn:executable' set on 'myscript.sh'
Perhaps you have an internal policy to set certain properties for the benefit of your coworkers:
 svn propset owner bob file.txt
 property 'owner' set on 'file.txt'
If you made a mistake in a log message for a particular revision and want to change it, use --revprop and set svn:log to the new log message:
 svn propset --revprop -r 99 svn:log "A comment"
 property 'svn:log' set on repository revision '99'
Or, if you don't have a working copy, you can provide a URL:
 svn propset --revprop -r 99 svn:log "A comment" http://mysvnrepo/svn/myproject/trunk
 property 'svn:log' set on repository revision '99'
Lastly, you can tell propset to take its input from a file. You could even use this to set the contents of a property to something binary:
 svn propset owner-pic -F file.jpg file.txt 
 property 'owner-pic' set on 'file.txt'

Wednesday, 8 March 2017

SVN tutorial n 30 - propget

The "svn propget" command prints the value of a property on files, directories, or revisions. The first form prints the versioned property of an item or items in your working copy, and the second prints unversioned remote properties on a repository revision.
The synopsi is:
svn propget PROPNAME [TARGET[@REV]...]
or
svn propget PROPNAME --revprop -r REV [URL]

Example:

svn proplist MyLauncher.java
Properties on 'MyLauncher.java':
  copyright
  license
svn propget copyright MyLauncher.java
(c) 2017 "L'informatica a modo mio" Blog
For more information about svn proplist command see the tutorial n 29.

Thursday, 2 February 2017

SVN tutorial n 29 - proplist

Just as Subversion uses properties to store extra information about the files, directories, and revisions that it contains, you might also find properties to be of similar use. You might find it useful to have a place close to your versioned data to hang custom metadata about that data.
The "svn proplist" command shows the List all properties. The synopsis is the following:
 svn proplist [<resource_target>[@<svn_revision>]...]

Example:

 svn proplist myscript.sh
 Properties on 'myscript.sh':
   svn:executable
If you use the --xml option, the result will be in xml format:
 svn proplist myscript.sh --xml
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<target
   path="myscript.sh">
<property
   name="svn:executable"/>
</target>
</properties>

Monday, 30 January 2017

SVN tutorial n 28 - switch

The "svn switch" command updates working copy to a different URL.
The synopsis is the following:
 svn switch <svn_url>[@<svn_rev>] [<local_path>]
This is the Subversion way to make a working copy begin tracking a new branch. If specified, <svn_rev> determines in which revision the target is first looked up.
If --force option is used, unversioned obstructing paths in the working copy do not automatically cause a failure if the switch attempts to add the same path.
The --relocate option is deprecated as of Subversion 1.7. Use svn relocate [1] to perform working copy relocation instead.

Example:

 svn switch http://mysvnrepo/svn/myproject/branches/mybranch .

Link

Tuesday, 24 January 2017

SVN tutorial n 27 - patch

The "svn patch" command applies the changes represented in a unidiff patch to the working copy. The synopsis is:
 svn patch <patch_file> [working_copy_patch]
This subcommand will apply changes described a unidiff-formatted patch file <patch_file> to the working copy working_copy_patch. As with most other working copy subcommands, if working_copy_patch is omitted, the changes are applied to the current working directory. A unidiff patch suitable for application to a working copy can be produced with the svn diff command or third-party differencing tools. Any non-unidiff content found in the patch file is ignored.

How to apply a svn patch

Apply a simple patch file generated by the svn diff command. Our patch file will create a new file, delete another file, and modify a third's contents and properties. Here's the patch file itself (which we'll assume is creatively named PATCH):
 cd <your_workingcopy>
 svn patch <path>/PATCH
Sometimes you might need Subversion to interpret a patch “in reverse”—where added things get treated as removed things, and vice-versa. Use the --reverse-diff option for this purpose. In the following example, we'll squirrel away a patch file which describes the changes in our working copy, and then use a reverse patch operation to undo those changes.
 svn diff > PATCH
 svn patch --reverse-diff PATCH

Monday, 9 January 2017

SVN tutorial n 26 - relocate

Sometimes an administrator might change the location (or apparent location, from the client's perspective) of a repository. The content of the repository doesn't change, but the repository's root URL does. The hostname may change because the repository is now being served from a different computer. Or, perhaps the URL scheme changes because the repository is now being served via SSL (using https://) instead of over plain HTTP. There are many different reasons for these types of repository relocations.
The svn relocate command has two syntaxes:
The first svn relocate syntax allows you to update one or more working copies by what essentially amounts to a find-and-replace within the repository root URLs recorded in those working copies. Subversion will replace the initial substring <from-prefix> with the string <to-prefix> in those URLs.
 svn relocate <from-prefix> <to-prefix> [<svn_path>]
Example:
 svn up
Updating '.':
svn: E180001: Unable to connect to a repository at URL 'file://var/svn/repos/myproject/trunk'
 svn relocate file:///var/svn/new-repos/myproject/trunk
The second syntax does not require that you know the current repository root URL with which the working copy is associated at all—only the new repository URL (<to-url>) to which it should be pointing. In this syntax form, only one working copy may be relocated at a time.
 svn relocate <to-url> [<svn_path>]
Example
 svn relocate http://new-svn-host.com/repos/myproject/trunk

Wednesday, 21 December 2016

SVN tutorial n 25 - mergeinfo

The svn mergeinfo command shows the query information related to merges (or potential merges) between a "source url" and "target". If the --show-revs option is not provided, display revisions which have been merged from "source url" to "target". Otherwise, display either merged or eligible revisions as specified by the --show-revs option. The svn mergeinfo command requires a "source" URL (where the changes come from), and takes an optional "target" URL (where the changes merge to). If no target URL is given, it assumes that the current working directory is the target.
The synopsis is:
 svn mergeinfo <source_url>[@<svn_revision>] [<target>[@<svn_revision>]]

Examples

Merge info between a branch and a working copy
 svn mergeinfo https://svnrepo/svn/myproject/branches/myproject-1.1
Merge info between a branch and trunk
 svn mergeinfo https://svnrepo/svn/myproject/branches/myproject-1.1@33 https://svnrepo/svn/myproject/trunk

Tuesday, 20 December 2016

SVN tutorial n 24 - unlock

The svn unlock command unlocks files or directories previously locked.  If any file (or directory) is locked by another user or no valid lock token exists in the working copy,
print a warning and continue unlocking the rest of the files (and directories). Use "--force" to break a lock belonging to another user or working copy. The synopsis is:
 svn unlock <path>
When a commit fails due to someone else's locks, it's fairly easy to learn about them. The easiest way is to run:
 svn stat -u

Examples:

1) unlock the files in working copy
 svn unlock file1.txt file2.txt fileN.txt
2) unlock a file already locked by another user
 svn unlock --force file1.txt
3) unlock a file via url
 svn unlock https://svnrepo/svn/myproject/trunk/file3.txt

Friday, 16 December 2016

SVN tutorial n 22 - log

The "svn log" command shows log messages from the repository. If no arguments are supplied, svn log shows the log messages for all files and directories inside (and including) the current working directory of your working copy. You can refine the results by specifying a path, one or more revisions, or any combination of the two. The default revision range for a local path is BASE:1.
Instead If you specify a URL alone, it prints log messages for everything the URL contains. If you add paths past the URL, only messages for those paths under that URL will be printed. The default revision range for a URL is HEAD:1. The synopsis is:
 svn log [PATH]
or
 svn log URL[@REV] [PATH...] 

Examples:

1) log of current folder
 svn log
2) log of a local file target
 svn log MyFile.txt
3) log of a file via url
 svn log https://mysvnrepo/svn/myproject/trunk/MyFile.txt
4) log for revision
 svn log -r 3:6 MyFile.txt
5) log for revision of a file via url
 svn log -r 3:6 https://mysvnrepo/svn/myproject/trunk/MyFile.txt
6) log in xml format
 svn log --xml https://mysvnrepo/svn/myproject/trunk/MyFile.txt

Thursday, 15 December 2016

SVN tutorial n 21 - list

The "svn list" command shows the entry list on repository, this command is simalar to onomimus bash command. The synopsis is:
 svn list <target>[@<svn_revision>]
or
 svn ls <target>[@<svn_revision>]
Where <target> can be the local working copy or remote url. If <target> is not present the command will show the current local directory.
You can use this command for a precise revision using -r option or the sintax with "@".
An other helpful option is --xml for the output format in xml.

Examples:

1) List of trunk via url
 svn list https://svnrepo/svn/myproject/trunk
2) List in myfolder (local copy)
 svn list myfolder
3) List of trunk via url with revision number 40 with xml format
 svn list --xml https://svnrepo/svn/myproject/trunk@40

Wednesday, 14 December 2016

SVN tutorial n 20 - export

The svn export command can be used in two modes: the first exports a clean directory tree from the repository specified by <svn_url> at revision <svn_revision> if it is given; otherwise, at <head>, into <path>. If <path> is omitted, the last component of the <svn_url> is used for the local directory name. The synopsis is:
 svn export [-r <svn_revision>] <svn_url> [<path>]
Example:
 svn export https://svnrep/svn/myproject/trunk/folder folder-new
A    folder-new
Exported revision 4.
Instead the second mode exports a clean directory tree from the working copy specified by <path1> into <path2>. All local changes will be preserved, but files not under version control will not be copied.
The synopsis is:
 svn export [-r <svn_revision>] <path1> [<path2>]
Example:
 svn export folder folder-new
Export complete. When rolling operating-system-specific release packages, it can be useful to export a tree that uses a specific EOL character for line endings. The --native-eol option will do this, but it affects only files that have svn:eol-style = native properties attached to them. For example, to export a tree with all CRLF line endings (possibly for a Windows .zip file distribution):
 svn export https://svnrep/svn/myproject/trunk/folder folder-new --native-eol CRLF
A    folder-new
Exported revision 4.
You can specify LR, CR, or CRLF as a line-ending type with the --native-eol option.

Tuesday, 13 December 2016

SVN tutorial n 19 - changelist

The svn changelist command associates (or deassociates) local paths with a changelist. I suggest to use this command when a svn commit is associated to a specific issue. The synopsis for associate is:
 svn changelist <clname> <files>
or
 svn cl <clname> <files>
instead the synopsis for deassociate is:
 svn changelist --remove <files>

Examples: 

1) Create a changelist:
 svn changelist issue1 Myfile.txt Myfile2.txt
 svn status
M       Myfile3.txt
--- Changelist 'issue1':
M       Myfile.txt
A       Myfile2.txt
 svn commit --changelist issue1 -m "Issue 1"
 svn status
M       Myfile3.txt
2) Deassociate files:
 svn changelist issue2 Myfile3.txt
 svn status
--- Changelist 'issue2':
M       Myfile3.txt
 svn changelist --remove Myfile3.txt
 svn status
M       Myfile3.txt

Monday, 12 December 2016

SVN tutorial n 18 - cat

The svn cat command displays on standard output the contents of the specified files or URLs. This command is similar as homonym bash command. The synopsis is:
svn cat <path>
The option -r is used for display the file with a specific revision number.
Examples:
svn cat MyFile.txt
svn cat https://mysvnrepo/svn/trunk/MyFile.txt
svn cat -r 123 MyFile.txt