Tag Archive for 'properties'

SmartSVN’s Project Settings: Properties

You can easily change how SmartSVN handles all your Apache Subversion projects using the popular, cross-platform client’s ‘global preferences’ settings. However, sometimes you’ll want to be more flexible and change SmartSVN’s settings on a per-project basis.

In this post, we take a closer look at the changes you can make to Subversion’s properties, on a project-by-project basis using SmartSVN’S ‘Project Settings’ menu.

Accessing Project Settings

To access SmartSVN’s Project Settings, open the ‘Project’ menu and select ‘Settings.’ The different options are listed on the dialog box’s left-hand side.

project settings

EOL Style

Subversion doesn’t pay attention to a file’s end-of-line (EOL) markers by default, which can be a problem for teams who are collaborating on a document across different operating systems. Different operating systems use different characters to represent EOL in a text file, and some operating systems struggle when they encounter unexpected EOL markers.

The ‘EOL Style’ option specifies the end-of-line style default for your current project. You can choose from:

  • Platform-Dependent/Native – files contain EOL markers native to your operating system.

  • LF (Line Feed) – files contain LF characters, regardless of the operating system.

  • CR+LF (Carriage Return & Line Feed) – files contain CRLF sequences, regardless of the operating system.

  • CR (Carriage Return) – files contain CR characters, regardless of the operating system.

  • As is (no convention) – this is typically the default value of EOL-style.

The ‘In case of inconsistent EOLs’ allows you to define how SmartSVN should handle files with inconsistent EOLs.

You can more about EOL Style at the ‘Subversion Properties: EOL-Style’ blog post.

EOL Style — Native

Usually, text files are stored with their ‘native’ EOL Style in the Subversion repository. However, under certain circumstances, it might be convenient to redefine what ‘native’ means, for example, when you’re working on a project on Windows but frequently uploading it to a Unix server. Open this dialog and choose from Linux/Unix, Mac or Windows.

Keyword Substitution

Allows you to automatically add ‘keywords’ into the contents of a file itself. These keywords are useful for automatically maintaining information that would be too time-consuming to keep updating manually.

You can choose from:

  • Author – the username of the person who created the revision.
  • Date – the UTC the revision was created (note, this is based on the server’s clock not the client’s.)

  • ID – a compressed combination of the keywords ‘Author,’ ‘Date’ and ‘Revision.’

  • Revision – describes the last revision in which the selected file was changed in the repository.

  • URL – a link to the latest version of the file in the repository.

  • Header – similar to ‘ID,’ this is a compressed combination of the other keywords, plus the URL information.

You can find out more about Keyword Substitution at our ‘Exploring SVN Properties’ post.

Learn more about the other options available in SmartSVN’s ‘Project Settings’ dialog by reading our Subversion Tip of the Week post.

Subversion Tip of the Week

Intro to Automatic Properties 

Properties are a powerful and useful feature of Apache Subversion, but they can be easily overlooked. If you’re regularly using properties in your project, it’s a good idea to configure Subversion to add properties to new files automatically.

Subversion already sets some properties automatically: whenever you add a new file, it sets a value for the MIME type and decides whether the file is executable. You can extend this by leveraging Subversion’s automatic property setting feature “svn:auto-props.” With auto-props enabled, you can perform tasks such as automatically inserting keywords into text files and ensuring every file has EOLs that are consistent with the OS.

To enable auto-props:

1) Locate and open the config file on your local machine.

2) Scroll down to the [miscellany] section and uncomment the following line:

# enable-auto-props = yes

auto props

3) Just below this line, edit the ‘Section for configuring automatic properties’ text according to the properties you want to apply to your files.

Subversion Properties: Needs Lock

Apache Subversion is built around a ‘copy-modify-merge’ model, but there are times when a ‘lock-modify-unlock’ model may be appropriate (for example, when you are working on image files, which cannot easily be merged.) Once you’ve mastered locking and unlocking, you may want to look at Subversion’s dedicated lock property, which is useful to help prevent time wasted working on files that have already been locked by others.

If present on a file, the ‘Needs Lock’ property reminds users that they should lock the file before starting work on it. The SmartSVN Subversion client automatically sets files which require locking (due to this property) to read-only when checking out or updating. When a lock token is present, the file becomes read/write. This prevents users from making changes that are difficult to merge, on a file that is also being edited in another working copy (for example, two users simultaneously editing an image file.)

To add this property to a file using SmartSVN, select a file and click the ‘Change Needs Lock’ option in SmartSVN’s ‘Locks’ menu.

smartsvn needs lock

SmartSVN will automatically add this property to the selected file.

smartsvn properties change

To remove the ‘Needs Lock’ property, repeat the process: selecting ‘Change Needs Lock’ for a file that already contains this property, will remove the property instead.

Looking for a cross-platform graphical client for Apache Subversion? Claim your free 30 day trial at www.smartsvn.com/download

 

Subversion Properties: Ignore Patterns

When working on your Apache Subversion project with SmartSVN, you may include items in your working copy that do not need to be placed under version control. While it’s possible to include unversioned items in your working copy, these items will continue to clutter up your Subversion dialogs, e.g the commit dialog:

The ‘Ignore Patterns’ property can be used to explicitly state which file patterns should be ignored within a directory. This helps the user filter out items that shouldn’t be under version control, and prevents Subversion from repeatedly asking whether these should be included in your Subversion activities.

To apply the ‘Ignore Patterns’ property:

1) Open the ‘Properties’ menu and select ‘Ignore Patterns…’

2) Enter the names of the files you wish to ignore. You can also use the * wildcard to instruct Subversion to ignore all files that:

  •  End with a certain file extension (*.png, *.txt, *.class)
  • Contain certain keywords (test_*, draft*)
  • Or alternatively, you can opt to ignore all files (*)

3) By default, only the patterns in the selected directory are ignored. Open the ‘Depth’ drop-down menu to view the other available options:

  • Only file children
  • Immediate children (files and directories)
  • Fully recursive (applies patterns to all subdirectories)

Remember, you can claim your 30 day free trial of SmartSVN Professional now. Want to find out more about Subversion Properties? There’s still time to register for our free ‘Subversion Properties‘ webinar. 

 

Subversion Properties: EOL-Style

By default, Apache Subversion doesn’t pay attention to a file’s end-of-line (EOL) markers, which can cause problems if you’re part of a team who are collaborating on a document across different operating systems. Different operating systems use different characters to represent the end of a line in a text file, and some operating systems can struggle when EOL characters do not align with their native EOL style.

There are a few workarounds for this issue, but any workaround that involves performing EOL-related modifications by hand leaves your project open to human error, and makes it difficult to distinguish which changes relate to the EOL workaround, and which actually move the project forward.

This is where the svn:eol-style property is useful. This property allows Subversion to automatically perform the necessary processing on a file, to ensure EOL consistency across operating systems. To leverage svn:eol-style, you must set the property to one of the following valid values:

  • Platform-Dependent/Native – files contain EOL markers native to your operating system.
  • LF – files contain LF characters, regardless of the operating system.
  • CR+LF – files contain CRLF sequences, regardless of the operating system.
  • CR – files contain CR characters, regardless of the operating system.
  • As is (no convention) – this is typically the default value of EOL-style.

To set EOL-Style in SmartSVN:

1) Open the ‘Properties’ menu and select ‘EOL-Style…’

2) In the subsequent dialog, select the new value.

3) When you attempt to change the EOL-style of a file, SmartSVN checks whether the file has consistent line endings. If it doesn’t, SmartSVN will block the EOL-style change. To skip this check and apply the EOL-style change regardless, select ‘Force’ before clicking ‘OK.’

4) Click ‘OK’ to apply the properties change.

Want to learn more about Subversion properties? On December 13th we will be holding a free ‘Subversion Properties’ webinar. It’s free to attend, but places are limited so register now to avoid disappointment.

Subversion Properties: SVN:Executable

Many operating systems’ ability to execute a file is governed by the presence of an execute permission bit. As this is typically disabled by default, Apache Subversion users may have to manually enable this permission bit every time they perform an SVN Checkout. If you’re going to be regularly using executable bits in your project, it’s a good idea to set the svn:executable property on the files in question. This internal Subversion property tells SVN which files should be executable, ensuring the correct permission bits are enabled whenever you perform a checkout. (Note, this property has no impact on filesystems that do not support executable permission bits.)

To set svn:executable in SmartSVN, the popular, cross-platform graphical client for Subversion, simply:

1) Select the file you wish to enable the execute permission bit for.
2) Open SmartSVN’s ‘Properties’ menu and select the ‘Executable-Property’ option.

3) Ensure the ‘Executable’ radio button is checked and click ‘Ok.’

4) Perform an ‘SVN Commit’ to share this properties change with the rest of your team.

Want to learn more about Subversion properties? On December 13th we will be holding a free ‘Subversion Properties’ webinar that will cover:

  • Defining properties
  • Property and “Standards and Procedures”
  • Property name rules
  • Automatic Properties
  • Recursively defining properties
  • Examining Properties
  • Removing Properties
  • Keywords

It’s free to attend, but places are limited so register now to avoid disappointment.

Exploring SVN Properties: MIME-Type and Keyword Substitution

‘Properties’ in Apache Subversion are a valuable way of associating metadata with versioned files or directories. In this SmartSVN tutorial, we’ll explore some of the Subversion internal properties in greater detail, before showing you how to remove a property.

MIME Type

The ‘svn:mime-type’ property indicates a file’s MIME type and allows the client to decide if contextual merging is safe during updates. SmartSVN automatically determines the coarse MIME-type of a new file, but in certain cases you may want to change SmartSVN’s assignment using the svn-mime-type property.

To set the MIME type property in SmartSVN:

1) Right-click the file where the svn:mime-type property will be set, and select ‘MIME-Type..’ from the ‘Properties’ menu.

2) In the subsequent ‘Change MIME-Type’ dialog, you can choose from the defaults ‘Text’ or ‘Binary’ type. Alternatively, define a ‘Custom’ type by explicitly specifying the corresponding MIME-type, for example image/jpeg, application/pdf etc.

3) By default, SmartSVN checks whether MIME-Types are well-formed, and not arbitrary strings. If you want to disable this check, select the ‘Force’ option.

4) Select ‘OK’ to go ahead and apply this new property.

Keyword Substitution

Subversion has the ability to substitute ‘keywords’ into the contents of a file itself. These keywords are useful for automatically maintaining information (such as author, revision number, etc.) that would be too time-consuming to update manually.

Note, the Keyword Substitution property can only be applied to text files.

1) To activate keyword substitution, right-click on the file in question and select ‘Keyword Substitution…’ from the ‘Properties’ menu.

2) In the ‘Change Keyword Substitution’ dialog, choose from a list of supported keywords:

Author – the username of the person who created the revision.
Date –
the UTC the revision was created (note, this is based on the server’s clock not the client’s.)
Revision –
describes the last revision in which the selected file was changed in the repository.
ID –
a compressed combination of the keywords ‘Author,’ ‘Date’ and ‘Revision.’  
URL –
a link to the latest version of the file in the repository.
Header –
similar to ‘ID,’ this is a compressed combination of the other keywords, plus the URL information.

You can choose to ‘Unset’ or ‘Set’ each keyword. The ‘Don’t Change’ option maintains the current substitution from the keyword.

Deleting a Property 

Once you start working with Properties in Subversion, sooner or later you will need to remove properties. To set or delete a property to multiple files or directories:

1) Open the ‘Properties’ menu and select ‘Set or Delete Property.’

2) Open the ‘Property’ drop down menu to see the available Subversion internal properties.

3) Select the Property you wish to remove. In this example, we’ll remove all explicit mergeinfo from our project. To achieve this, select ‘svnmergeinfo’ and select the ‘Delete Property’ checkbox.


4)
Select ‘OK’ to remove the mergeinfo.

Remember, you can download your free edition of SmartSVN Foundation at http://smartsvn.com/

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.

SmartSVN: Set or Delete Property

‘Properties’ in Apache Subversion are useful for associating metadata with files under version control. In this post, we’ll begin to look at how properties can be used in SmartSVN, by exploring the ‘Set or Delete Property…’ option.

Remember, you can download your free edition of SmartSVN Foundation at http://smartsvn.com/

1) Open the ‘Properties’ menu and select the ‘Set or Delete Property’ option.

 

 

 

 

 

2) Open the ‘Property’ drop down menu to see the available Subversion internal properties. These are:

  • svn:eol-style – used to determine the processing that should be performed on a file. This property is useful for when commits are being made with different operating systems.
  • svn:executable – can be used to control a versioned file’s filesystem-level execute permission bit.
  • svn:externals – used to define or change externals.
  • svn:ignore – contains a list of file patterns that Subversion operations should ignore.
  • svn:keyword – instructs Subversion to substitute ‘keywords’ into the files themselves. These keywords could be a revision number, the name of the person who last changed the file, or other useful information.
  • svn:mergeinfo – used to query information related to merges.
  • svn:mime-type –  determines some of Subversion’s behavioral characteristics, and serves as a place to store a file’s MIME classification.
  • svn:needs-lock – if this property is set, the local copy of a locked file is automatically made read-only unless the user owns the lock in question.

 

 

 

 

 

 

 

 

 

 

3) From this screen, you can either set or delete a property. In this example, we’ll remove all explicit mergeinfo from our project. To achieve this, select svnmergeinfo and select the ‘Delete Property’ checkbox.

 

 

 

 

 

 

 

 

 

 

4) Select ‘Ok’ to remove the mergeinfo.

Note. This is a basic example of using Properties in SmartSVN. More information is available at WANdisco’s SmartSVN docs.

Catch up on the rest of our intro to SmartSVN series:

WANdisco’s June Roundup

Happy summer! As well as enjoying the nice weather and longer days, this month we announced an exciting update for the uberSVN community.

uberSVN keeps going from strength to strength and, with an ever-growing community of users, we need your feedback more than ever to ensure we continue to deliver the features and functionality you need. Have some thoughts on the uberSVN user interface? Head over to SVNForum.org now to read our proposals for a redesigned Users/Teams tab and a redesigned Admin tab. If you’re a registered SVNForum.org user you can join the discussion by posting at the relevant thread (if you’re not already registered, then signing up is quick and easy!) Alternatively, send us your feedback directly.

We also announced a dedicated channel for keeping in touch with the uberSVN community, the Latest Release Channel. Everyone signed up to the Latest Release Channel will get a sneak preview of upcoming releases at least a few weeks before the rest of the uberSVN user base. This gives you the opportunity to test new features and see how they fit into your ALM environment before the update becomes widely available.

Members of the Latest Release Channel already have access to an update to uberSVN Chimney House. This update features a list of improvements and new functionality, including:

  • Improvements to uberSVN APIs and internal development of uberSVN SDK.
  • Further improvements to the way uberSVN handles LDAP and LDAPS.
  • New manageAPPS page allows you to see metadata attached to your APP license.
  • The latest Apache Subversion 1.7.5 binaries set to active by default.
  • …..and more!

Not on the Latest Release Channel? Expect to see the uberSVN Chimney House update in the Stable Release Channel within the next two weeks. We’ve had a great uptake on the Latest Release Channel so far – if you’re an uberSVN user who wants to make your voice heard, then head over to our blog announcement to find out more.

But it hasn’t all been about uberSVN, we’re pleased to announce that registration for Subversion Live 2012 will be opening shortly!

After getting a great response from the Apache Subversion community in 2011, this year’s conference series is bigger and better than ever, with events taking place in San Francisco (October 10th & 11th) Greenwich, Connecticut: (October 16th & 17th) and London (October 23rd & 24th).

This year’s sessions will include:

  • What’s coming in 1.8
  • Merge & Performance Improvements
  • Hook Scripts
  • Branching & Merging Best Practices

We look forward to meeting up with the Apache Subversion community later this year! In the meantime, be sure to follow @WANdisco and @uberSVN for all the latest conference news.

If you can’t wait until the conference for your Subversion training, we’ve just announced another set of free SVN training webinars for the Apache Subversion community. After receiving lots of feedback, we’ve added another one hour course on branching and merging, alongside plenty of other webinar goodness:

Finally, fancy winning an iPad or a Kindle Fire? You may remember we announced the 2012 Worldwide Developer Survey last month. The survey will help us to build a picture of the developer’s perspective on software development, and trends in the software change and configuration control management tools market. We already announced that, at the end of the Worldwide Developer Survey we’ll make the results available to everyone who took part but we’ve been so pleased with the response that we’re also entering all respondents into a prize draw. The top prize will be an iPad, with two lucky runners-up receiving a Kindle Fire. If you haven’t completed the survey, make sure you send us your answers before 13th July 2012 to be in with a chance of winning an iPad or Kindle Fire.

Good luck!