Tag Archive for 'version control'

Subversion Tip of the Week

Tagging and Branching with SmartSVN’s ‘Copy Within Repository’

SmartSVN’s ‘Copy Within Repository’ command allows users to perform pure repository copies, which is particularly useful for quickly creating tags and branches.

To create a repository copy within SmartSVN:

1) Open the ‘Modify’ menu and select ‘Copy within Repository’.

2) From the ‘Copy From’ dropdown menu, select the repository where the source resides.

3) In the ‘Copy From’ textbox, specify the directory being copied. In ‘Source Revision,’ tell SmartSVN whether it should copy the HEAD revision (this is selected by default) or a different revision. Use the ‘Browse’ button if you need more information about the contents of the different directories and/or revisions that make up your project.

copy within repo

4) Select either:

  • Copy To – source is copied into the ‘Directory’ under the filename specified by ‘With Name’

  • Copy Contents Into – the contents of the source are copied directly into the ‘Directory’ under ‘With Name.’

5) Enter the copy’s destination in the ‘Directory’ textbox. You can view the available options by clicking the ‘Browse’ button.

6) Give your copy a name in the ‘With Name’ textbox.

7) The copy is performed directly in the repository, so you’ll need to enter an appropriate commit message.

8) Once you’re happy with the information you’ve entered, hit ‘Copy’ to create your new branch/tag.

Try SmartSVN Professional free today! Get a free trial at http://www.smartsvn.com/download.

WANdisco Announces Free Subversion Webinars for 2013

After getting a fantastic response to our free Subversion webinars in 2012, we’re pleased to announce the first webinars of 2013.

Getting Started With Subversion

A one-hour course to kickstart newcomers to both Subversion and version control in general, covering everything you need to get up and running with this popular open source version control system.

The webinar will cover:

  • Repository basics
  • Performing commits
  • Performing checkouts
  • Simple merging
  • The working copy
  • Simple branching

Getting Started With Subversion’ will take place on January 24th, 2013 10:00am PST / 1:00pm EST, so be quick to avoid missing out.

Branching Options for Development

Branching can cause confusion for many Subversion users, but once mastered it can be one of Subversion’s greatest strengths. In this one hour webinar our Subversion expert will cover the different types of branches and deep dive into their particular uses. Topics covered will include:

  • What is concurrent development?
  • What is a branch?
  • Different development models
  • What triggers a branch?
  • Communication for branching and merging

‘Branching Options for Development’ will take place on February 14th, 2013. Registration will open soon, so keep checking back for all the latest information or follow us on Twitter.

Getting Info out of Subversion

Need to build a report based on your Subversion project? This free-to-attend online training will share techniques for extracting information out of Subversion, for reporting purposes.

Topics will include:

  • Log information
  • Property information
  • Difference information
  • Using Project and User information
  • Using Hook scripts to log information

Getting Info out of Subversion’ will take place on February 28th, 2013.

Have an idea for a future webinar, or feedback on our current schedule of free Subversion training? Please don’t hesitate to leave us a comment on this blog, or Contact Us directly.

 

Top Five Features of SmartSVN 7.5

Earlier this week, WANdisco announced the release of SmartSVN 7.5, the popular, cross-platform graphical client for Apache Subversion. This release introduces plenty of new features and brings major updates to existing SmartSVN functionality.

In this post, we cover five of the top new features in SmartSVN 7.5.

1) New GUI

In this release, SmartSVN moves from Swing to a SWT GUI platform, bringing the user improved responsiveness and a native look and feel.

2) Increased Security

SmartSVN 7.5 introduces plugin security improvements, including support for safe password storage with the Plugin-API. Other Plugin-API improvements include higher grade encryption, and the option to validate that the plugin is the same for everyone, by applying a password (note, this is an admin only feature.) These security updates ensure that SmartSVN 7.5 is safer and easier to extend than ever before.

3) Improved User Experience

The relaxation of master password means that SmartSVN 7.5 remembers your password for more activities, cutting down on unnecessary interruptions and allowing you to focus on the tasks that matter to you. Other changes that are designed to improve the overall user experience, include:

  • The option to edit properties directly in the Repository Browser
  • Remove, Move and Copy now operate on multiple selected directories

4) Full Support for Working Offline

Need to continue working on your repositories, even when you don’t have access to the internet? SmartSVN 7.5 supports working offline, with the following functionality automatically available as soon as you disconnect from the internet:

  • Communication streams disconnect when offline mode is detected
  • Remote states and Transactions are no longer refreshed
  • Logs and Revision Graph are performed on the Log Cache only

5) Completely Overhauled Revision Graph

SmartSVN’s Revision Graph displays the hierarchical history of a file or directory, and has similar functionality to that of the Log command (for example, comparing two revisions of a certain file) but with a greater level of detail.

The Revision Graph allows you to instantly see:

  • which changes happened in which branch
  • which revision represents which tag
  • when a file was moved, renamed or copied along with its history

The Revision Graph UI has been completely reworked in SmartSVN 7.5:

Other major updates include highlighting ‘mergable’ revisions even if no mergeinfo is loaded. The ‘Export’ option also exports HTML files with a lot of small graphic files, instead of one large file, leading to performance and loading improvements.

Users will also notice:

  • New menu item for selecting shown branches
  • Tag symbols are now displayed for all copies that are tags (according to the tag-and-branch layout)
  • Preferences option to skip initial configuration dialog after install
  • Bug fixes for the switch View options and Revision Info tool window

Want to find out more about SmartSVN 7.5? The full list of what’s new and noteworthy, can be found at the Changelog. If you haven’t already tried SmartSVN, you can claim your free 30 day trial of SmartSVN Professional now.

Working with Patches in SmartSVN

SmartSVN supports the creation and usage of ‘patches’ – text files containing the differences between two files. Patches specify which lines have been removed, added and changed, and are particularly useful when you don’t have write access to a repository. In these instances, you can create a patch file showing the changes between a file as it exists in the repository, and the version in your working copy. Then, you can create a ticket and attach your patch file, for someone with repository write access to review and commit the accepted changes to the repository.

Patches are created by comparing two revisions of your project (or by comparing your local changes to the version in the repository) and generating a local patch file.

Create a Patch in SmartSVN

To create a patch file in SmartSVN:

1) Open the ‘Query’ menu and select ‘Create Patch…’

2) In the subsequent dialog, select the ‘Choose’ button.

3) In the ‘Save File’ dialog, choose the file path where your patch will be stored, and enter a name for your path.

4) Select ‘OK’ to return to the ‘Create Patch’ dialog. Select ‘Create Patch.’

5) SmartSVN will confirm the creation of your patch, and remind you where this patch has been stored.

You have now successfully created your first patch in SmartSVN!

Create a Patch Between URLs

1) Open the ‘Query’ menu and select ‘Create Patch Between URLs…’

2) In the ‘Create a Patch between URLs’ dialog, specify the ‘from’ path and the ‘to’ path, and select the revisions you wish to compare and create a patch for. Alternatively, you can opt to compare the HEAD revisions of two paths.

3) Finally, enter the location where the patch should be saved. Once you are happy with the information you have entered, click ‘OK’ to go ahead and create the patch.

Need more help with your SmartSVN installation? SmartSVN Professional includes one year of email support. Find out more at http://www.smartsvn.com/buy

Getting More out of Version Control with SmartSVN

In our previous SmartSVN posts, we covered essential functionality to get you off to a flying start with this cross-platform graphical client for Apache Subversion. In this post, we cover some more advanced options, including performing a reverse merge, reverting local changes and resolving any conflicts that occur when you try to perform a commit with SmartSVN.

Didn’t catch our intro to SmartSVN series? Get up to speed with the following links:

Reverse Merge

As Subversion remembers every change that’s committed to the repository, it’s possible to revert to previous revisions of your project. This is useful if you introduce a code-breaking feature in revision 15, and need to revert to a revision before it all went wrong. This is achieved by performing a ‘reverse merge’ i.e merging the changes in your current revision, to an earlier revision.

To perform a reverse merge with SmartSVN:

1) Select the ‘Merge’ item from the ‘Modify’ menu.

2) In the Merge dialog, enter the revision number you wish to roll back to.

 

 

 

 

 

 

 

If you need more information about the different revisions, click the ‘Select…’ button next to the ‘Revision Range’ textbox. The subsequent dialog displays the different revisions, alongside the commit message, time, author and path data for each revision. Note, the green arrows indicate revisions not yet merged.

 

 

 

 

 

 

 

3) Ensure the ‘Reverse merge’ checkbox is selected and finally, click ‘Merge.’

4) Remember to commit your changes to the repository, to make this reverse merge permanent!

Alternatively, right-click the revision you wish to reverse-merge in the Transactions tool window and select “Rollback.”

Revert

Revert overwrites any local changes made to the working copy, with the file content held in the repository. Note, this command should be used with caution: a revert effectively deletes all the changes made since your last commit, and once they are gone there is no way to recover them.

To perform a revert with SmartSVN, right-click on the file/directory you wish to revert, and select the ‘Revert’ option from the drop-down menu  (alternatively, select the ‘revert’ button from the toolbar.)

 

 

 

 

 

 

 

SmartSVN will ask you to confirm the revert. Select the ‘Revert’ button to go ahead and remove all your local changes.

 

 

 

 

Relocate

At some point during your project’s lifecycle, your repository may change location and therefore get a new URL. This can be solved by deleting your working copy and performing a checkout from the new repository location, but there is a quicker way to solve this problem: the ‘Relocate’ command can be used to rewrite all the URLs associated with the files and folders in your working copy, with the new URLs. This allows you to continue using your current working copy and, of course, to successfully commit all your hard work back to the repository.

1) Open the ‘Modify’ menu and select ‘Relocate…’

2) The ‘Relocate’ dialog displays the URL of the selected directory. In the ‘To URL’ option, specify the replacement URL.

 

 

 

 

 

 

3) Select ‘Relocate’ to change the repository for your directory.

Note, this operation should be used with caution, as if used incorrectly it can corrupt your working copy. The ‘Relocate’ command should not be used to:

  • move to a different Subversion repository.
  • switch to a different branch or directory within the same repository.

Resolving Conflicts

When you are performing a commit in Apache Subversion, you may occasionally encounter the dreaded Subversion conflict, and your commit will fail. Thankfully, SmartSVN comes with a ‘conflict solver’ to help resolve these conflicts when they do occur. To access this conflict solver, open the ‘Query’ menu and select ‘Conflict solver.’

 

 

 

 

 

 

 

 

 

 

In the ‘Mark Resolved’ dialog, you can opt to:

  • Leave the file/directory as it is.
  • Take the version in the working copy, as it was before the update or merge was performed.
  • Take the new version – the pristine copy after the update or merge was performed.
  • Take the old version – the pristine copy before the update or merge was performed.
Select the appropriate checkbox and select ‘Ok.’ The conflict should now be resolved, and you can commit your changes to the repository to make them permanent.
Set a Property
‘Properties’ in Subversion are useful for associating metadata with the files placed under version control. To set a property for your Subversion files or directories using SmartSVN, open the ‘Properties’ menu and click ‘Select or delete Property….’
Use the drop-down ‘Property’ menu to select the desired Subversion internal property. The default properties are:
  • svn:eol-style – makes the client convert line-endings in text files. This property is used when the working copy is required in a specific EOL style.
  • svn:executable – makes files on Unix-hosted working copies executable.
  • svn:externals – a multi-line value defined on a directory that allows parts of other repositories to be automatically checked out.
  • svn:ignore – a list of unversioned filename patterns that should be ignored by ‘svn status’ and other subcommands.
  • svn:keywords – Subversion has the ability to substitute keywords into the contents of a file itself when changes are made. Keywords are useful for automatically maintaining information (such as author, revision number, etc) that would be too time-consuming to keep changing by hand.
  • svn:mergeinfo – this property is used to track merge data and is automatically maintained by the ‘SVN merge’ command.
  • svn:mime-type – indicates the file’s MIME type and allows the client to decide if contextual merging is safe during updates. Note, this property affects the handling of diffs and merging.
  • svn:needs-lock – tells the client that files should be checked out with permissions set to read-only. This is designed to be used in conjunction with the ‘SVN Lock’ command, to remind the developer to obtain a lock before beginning work on a file. This saves the developer from spending time modifying a file and then discovering it’s locked when it’s time to commit.

Select a value for your property (if applicable) and hit the ‘Ok’ button to set the new property.

Visit http://smartsvn.com/ to claim your free download of SmartSVN Foundation.

Intro to SmartSVN Change Sets

In Apache Subversion, it’s not unusual for developers to be working on multiple unrelated changes at the same time, in the same project. To distinguish between the different ongoing tasks in your project, SmartSVN supports ‘change sets’, groups of committable files and directories. Not only do change sets allow you to bring some order to your commits and updates, but it’s useful for grouping files together in order to commit them later. These change sets are an extension to the Subversion changelists.

In this short tutorial, we’ll provide an introduction to SmartSVN’s change sets by showing you how to create your first change set, and then how to add and remove files from them.

How to Create Your First Change Set

1) Select the files you wish to add to a new change set.

 

 

 

2) Open the ‘Change Set’  menu and select ‘Move to Change Set….’

 

 

 

3) Enter an appropriate message, which will be displayed as the name of the changelist, and decide whether you want SmartSVN to automatically delete the change set if it ever becomes empty. Select ‘OK’ once you are happy with the information you have entered.

 

 

 

 

 

 

 

 

 

 

4) SmartSVN will now go ahead and add these files to the change set.

 

 

 

If you don’t want to see them in the normal Files view, unselect View|Files Assigned to Change Set. This allows you to (temporarily) hide even unchanged or modified files which otherwise would clutter the file list.

How to Add a File to an Existing Change Set

1) Select the file you wish to add to an existing change set, followed by the ‘Move to Change Set…’ option.

2) Ensure the ‘Existing Change Set’ option is selected, and select the existing change set of your choice from the ‘Target Change Set’ combobox.

 

 

 

 

 

 

 

 

 

 

3) Select ‘OK’ to add this file to the existing change set.

Remove a File from a Change Set

1) To remove a file from a Change Set, select the file and open the ‘Move to change set…’ dialog.

2) Select the ‘Remove form Change Set’ option and click ‘OK’.

 

 

 

 

 

 

 

 

 

 

Right-click a Change Set to commit it. The change set’s Message will be used to prefill the commit message.

Not yet started with SmartSVN? You can download a free SmartSVN Foundation edition at http://smartsvn.com/

Apache Subversion 1.6.19 Arrives!

The Apache Subversion community has just announced a new release of the Subversion 1.6 series.

Apache Subversion 1.6.19 includes fixes and enhancements for users of 1.6.x:

  • A fix for a server hang that could occur if a hook script failed to start.
  • A fix for a write-through proxy commit regression introduced in Subversion 1.6.17.
  • Partial sync drops properties when converting to adds.
  • A fix for the testsuite to avoid FAILs on APR hash order.

More information on Subversion 1.6.19 can be found in the Changes file.

The latest, certified binaries can be downloaded for free from the WANdisco website, and are also available through the award winning, open uberSVN platform. Users of uberSVN can easily switch between the 1.6.19 and the latest 1.7 releases (or vice versa!) using uberSVN’s innovative ‘SVN Switch’ feature.

If you haven’t tried uberSVN yet, remember that it’s free to download and free to use! Simply visit http://www.wandisco.com/ubersvn to get started.

If you want all the latest news, tips, tricks and best practices on Apache Subversion, then why not check out Subversion Live 2012, the series of dedicated Subversion conferences? This year, events will be taking place in London, San Francisco and Greenwich, Connecticut, and will feature a unique mix of sessions, expert-led best practices workshops and invaluable networking opportunities for the SVN community.

Subversion Tip of the Week

Relocating a Working Copy

At some point during the Apache Subversion development lifecycle, your repository may change location – and therefore get a new URL. This may be because the IP address of the server has changed, or the repository root path in the server setup could have changed.

This can be particularly problematic if you’ve put some serious effort into modifying your working copy, as it effectively prevents you from performing an ‘SVN Commit…’ In this instance, checking out a fresh working copy from the new location and porting your changes across, could be a daunting task! This is where the ‘Relocate’ command comes into play. This command rewrites all the URLs associated with the files and folders in your working copy, with the new URL.

1) Start by selecting the ‘Relocate’ command from the TortoiseSVN menu.

2) Specify the URL you want to switch to and click ‘Ok.’

3) TortoiseSVN will then relocate to the new URL.

Warning! This operation should be used with caution, as if used incorrectly it can corrupt your working copy. In this happens, the only solution is to perform a fresh checkout.

The ‘Relocate’ command should not be used to:

    • move to a different Subversion repository.
    • switch to a different branch or directory within the same repository.

Need more Subversion know-how? After getting a great response from the Apache Subversion community in 2011, Subversion Live is back for 2012, bringing the Subversion community sessions covering everything from Subversion’s future, to expert-led best practices workshops, as well as the unique opportunity to meet the core Subversion committers.

Getting More Out of Version Control

So, you’ve downloaded Apache Subversion and have mastered the standard workflow – but this is just the start of what the world’s most popular version control system has to offer! In this post, we’ll dig a little deeper into Subversion and provide an overview of five features that can help you get even more out of version control, including discovering who is responsible for a specific change, and reverting to a previous version of your project.

1. Hook Scripts

Hook scripts are essentially programs that are triggered by a specific repository event. Usually, hook scripts are server side, but it’s also possible to run client side hook scripts. Hook scripts can be configured to perform the following tasks:

    • Reporting on events (e.g emailing alerts when a commit occurs.)
    • Testing for a pre-condition before allowing a commit (e.g checking a commit is accompanied by a log message)
    • Blocking certain actions (e.g blocking a commit that contains multi-gigabyte files)

 

The hooks subdirectory is automatically created along with each new repository. By default, the hook files are saved as non-executable templates (.tmpl) To make changes to these files, you simply open them as text-based documents, enter the new text, and save the file in a new format. This format is different for each operating system, for example, in Windows, the format can be either .exe or .bat.

Need some more help getting started with hook scripts? Our ‘Introduction to Subversion Hook Scripts on Windows’ has a handy example of a pre-commit hook.

2. SVN Blame

Sometimes, you just need someone to blame! Subversion’s ‘blame’ command does exactly this: it displays each line of a particular file, along with who changed each line, and in which revision it was changed. This is obviously useful for pin-pointing who is responsible for bugs and broken code, but it can also be useful for finding out who you need to contact for more information about a particular part of your code.

To find out who is to blame for a particular change, right-click on the file in question and select ‘Blame’ from the TortoiseSVN menu.

In the TortoiseSVN dialog, select the revisions you wish to review, and click ‘Ok.’

This will bring up the TortoiseBlame dialog, where you can see the changes that were made to the file in each revision, and who is responsible for each change.

For more information on a particular revision, hover over that revision and a tooltip will appear displaying the revision’s log message.

3. SVN:Ignore

Sometimes, there will be files in your working copy that don’t need to be placed under version control (you own notes, or a To Do checklist, for example) In these instances, Subversion’s ‘Ignore’ property can be used. Simply create/drag-and-drop the new file into your working copy, right-click to bring up the ‘TortoiseSVN’ sub-menu, select ‘Add to ignore list’ and select the file you wish to ignore.

This file will then be added to the ‘ignore’ list, and will not be accidentally committed back to the repository when you perform an ‘SVN Commit.’

4. Reverse Merge

Subversion remembers every change that’s made to its files and directories; a potential life-saver if you introduce a code-breaking feature in revision 12, and need to revert to a revision before it all went wrong. Recovering previous revisions in Subversion, is simply a matter of performing a reverse merge i.e merging the changes in your current revision, to an earlier revision. To perform a reverse merge with TortoiseSVN:

1) Select ‘Merge’ from the TortoiseSVN menu.
2) Select the ‘Merge a range of revisions’ option.
3) Select the revision you wish to revert to. Ensure the ‘Reverse merge’ option is selected.

4) The following dialog will present you with a number of options for merging – in most instances the default settings can be used. Click ‘Merge’ and Subversion will roll back to revision 11. Note, that the reverse merge only affects your working copy, so you must perform an ‘SVN Commit’ to commit your changes back to the repository.

5. Revert Command

Less drastic than a reverse merge, the revert command overwrites any local changes made to the working copy, with the code held in the repository, including any property changes and any scheduling operations that may have been set on the working copy. However, this command should be used with care: the revert command replaces all the changes made since your last commit, and once they are gone there is no way to recover them.

Need more help with your Apache Subversion installation? Every Monday, we’ll be publishing a new Tip of the Week at our blog, so keep checking back every week for all the latest tips!

Making Your Version Control Solution Agile

Maintaining a successful version control system is an important part of an agile project: version control allows you to easily roll back to a previous revision rather than manually unpicking changes; makes it easy to share your latest changes across distributed teams, and provides you with a quick and convenient sandbox in the form of a branch. These are just some of the benefits of version control, but there are some measures you can take to get even more out of your system. In this post, we share five tips for making your version control solution agile.

1) Set some guidelines

Maintaining a version control system can be a complex task, so implementing some guidelines – and making sure your whole team sticks to them! – can save you from unnecessary admin work later on.

  • Plan your layout – implementing a logical project layout from the very beginning can save you time and energy at a later date. Some version control systems, such as Apache Subversion, don’t impose a particular project structure, so it’s even more important to plan your layout in advance.
  • Be consistent with your file/folder names – a logical naming convention will make it easy to locate particular items.
  • Make your guidelines easily accessible – any conventions should be explained in a coding conventions file, which must be accessible to all members of your team. Consider placing these coding conventions under version control alongside the rest of your project, so they are always to hand.

2) Your code should always compile

In an agile project your code should always compile, which is where version control’s branching and merging functionality comes in handy. Any experimental development or new features should be confined to separate branches, and they should only be brought into the trunk when they’ve been tested to check they won’t break the build. This will ensure that the code in the trunk is always stable, and always compiles.

3) Place your whole project under version control

Version control isn’t just for source code management; you should place all files and folders related to your project under version control. Not only will this make it easier to locate files by keeping everything related to your project in one place, but version control’s ability to roll back to previous revisions is useless if you cannot then use that previous revision, or if you need to spend hours re-instating a list of related tools. Documentation, tools and libraries are all worth placing under version control, alongside your code.

4) Use Branches Wisely

Branches work best when they’re short lived. Being able to create a branch and customize the code to fit a particular customer’s requirements is one of the benefits of version control, but beware of maintaining this branch indefinitely alongside your main development line – multiple codebases can be costly and time-consuming to maintain.

5) Consider Enterprise Version Control Solutions

Our Subversion MultiSite solution combines open source Apache Subversion version control technology with value-added functionality designed to help teams stay agile, including:

  • No single point of failure
  • Automated failover
  • Built-in continuous hot backup and automated recovery
  • Continuous build integration
  • ….and more.

Want to learn more about Subversion MultiSite? On June 6th, 2012 WANdisco will hold a free webinar looking at the findings of an independent Forrester TEI study of a Fortune 500 company that implemented Subversion MultiSite. Visit the ‘Forrester Research on Optimizing Global Distributed Software Development Using Subversion’ page now to register.