Menu
Create Custom Side Menus
Frodo's Ghost | SVN Change Lists – Like GIT Staging
50548
post-template-default,single,single-post,postid-50548,single-format-standard,eltd-core-1.0.1,ajax_fade,page_not_loaded,,borderland - frodosghost-child-ver-1.0.0,borderland-ver-1.2, vertical_menu_with_scroll,smooth_scroll,side_menu_slide_with_content,width_470,paspartu_enabled,paspartu_on_bottom_fixed,wpb-js-composer js-comp-ver-4.4.4,vc_responsive
Subversion

SVN Change Lists – Like GIT Staging

I have been embedded into an existing development team for a month contract, and doing so means returning to using SVN for version control. Larger businesses find it difficult to change systems, and step into the future, or even today – IE8 is a great example of this lack of change. New infrastructure is always time consuming to implement when the old works. And SVN seems so old now, compared to GIT.

This time I have been using SVN from the CLI, which I didn’t do last time. In the past I had used TortiseSVN for handling commits, but the linear commit to a shared repository has limitations after using GIT for a few years.

One little trick that I have picked up this time, is using Change Lists. It is a essentially the ‘staging’ feature used in GIT. which means making commits to smaller collections of files, in the midst of a lot of changes, can be done.

What is done:

First you create a list of changes

svn changelist foo mydir/dir1/file1.c mydir/dir2/myfile1.h
svn changelist foo mydir/dir3/myfile3.c etc.

Then you can view the files assigned to the Change List:

$ svn status
? mydir/frank.appcache
M mydir/dir1/main.js

--- Changelist 'foo':
M mydir/dir1/file1.c
A mydir/dir2/myfile1.h
A mydir/dir3/myfile3.c

Then commit the changes in the change list

svn commit -m "Commit message in here." --changelist foo

## Remove Items from Change List

If there is a file added to the Change List that should be removed, then just use:

svn changelist --remove

## Bonus Points

Using the option `–keep-changelists` will allow you to build a list of files, with an assigned change list, and will keep the list after the commit. This way you could create a reusable change list, for example of less files, that can be reused in commits without having to build the list each time.

svn changelist bar mydir/dir1/file1.c mydir/dir2/myfile1.h --keep-changelists

Notes

  • Change lists can be assigned only to files—Subversion doesn’t currently support the use of changelists with directories.
    They only apply to your local machine, they are not pushed into the repository in a collection.

Further Reading

View the documentation.

Tags:
james
No Comments

Post a Comment