Eazysvn 1.12.1

Make simple revision merges and branch switching much easier
Eazysvn is a Python module that simplifies some common operations with Subversion branches.

Usage

Getting help

At the shell prompt type

eazysvn help

It will print a list of commands. Some of the commands have aliases:

ezswitch = eazysvn switch
ezmerge = eazysvn merge
ezrevert = eazysvn revert
ezbranch = eazysvn branchurl


Switching between branches

In a subversion working directory run

ezswitch -l

to see all the branches available in your project. This assumes your Subversion repository uses the standard layout with 'trunk', 'tags', and 'branches' in it.

Then run

ezswitch branchname

to switch to a branch, and

ezswitch trunk

to switch back to trunk.

Working with branches

Say you're working on a project and in the middle of a difficult refactoring suddenly realize the changes you've made are too risky for trunk you want to put them in a branch. Run

ezswitch --create my-branch

This will create a new branch and switch your working directory to it. All your changes in progress are kept intact and you can commit them directly to the new branch with svn commit.

Seeing all the changes on a branch

You may want to see the overall diff of changes made on a branch since it was created, say, to review it before attempting a merge.

eazysvn branchdiff branchname

does exactly that. For extra readability, install colordiff and use

eazysvn branchdiff branchname | colordiff | less -R

Merging branches

After you've finished hacking on your branch, you will want to switch back to trunk and start merging. Run

ezswitch trunk

then

ezmerge my-branch

You will see the svn command used for the merge as well as a log of all the changes. Fix merge conflicts (if any), run the test suite, then commit. The output of ezmerge helps you produce an informative commit message.

If instead of merging the changes to your working directory you'd like to see the combined diff, pass the -d (or --diff) option to ezmerge

ezmerge -d featurebranch

Cherrypicking

If you want to merge only some of the changes made in a branch, you can pass the revision number (or a range) to ezmerge. For example, to backport a bugfix implemented in revision 1234 of trunk to a release branch,

ezswitch release-branch
ezmerge 1234 trunk


You can also merge a range of revisions

ezmerge 1234-1236 trunk

This range is inclusive, unlike Subversion. If you want to, you can also use Subversion-style half-open ranges as well

ezmerge 1233:1236 trunk

The --diff option works here too.

ezmerge -d 1234-1236 trunk

Reverting comitted changes

It's like cherrypicking, but in reverse: you want to unapply changes already committed to this branch.

ezrevert 1234

Making tags

To tag the current version of the source tree in your working directory, run

eazysvn tag tagname

Manipulating branches

To remove a branch completely, run

eazysvn rmbranch branchname

To rename a branch, run

eazysvn mvbranch oldbranchname newbranchname

To do other kinds of operations, eazysvn provides a shortcut that lets you use branch names instead of full branch URLs (this bit assumes a Unix-like shell):

svn ls $(ezbranch branchname)
svn diff `ezbranch branch1` `ezbranch branch2`


Another possibly useful eazysvn command is branchpoint. It shows the revision when a branch was created. For example, to see the changes in trunk that are not present in a branch, run

svn diff -r `eazysvn branchpoint branch`:HEAD `ezbranch trunk`

Overall options

All commands that require a branch name as an argument accept a -l (or --list) option that lists all branches, e.g.

ezbranch -l

All commands that make changes to the repository or working directory accept a -n (or --dry-run) option that just prints the svn commands that would otherwise be executed.

ezmerge -n 1234 otherbranch

All commands that make changes to the repository (create/remove/rename branches or tags) accept a -m option with a commit message. If not specified, you'll get a text editor spawned by subversion itself to type the commit message.

ezswitch -c newbranch -m "Create branch for the new feature"

Many of the commands accept other options as well. Use

eazysvn cmd --help
ezmerge --help
ezswitch --help
etc.


to discover those.

last updated on:
September 16th, 2010, 2:59 GMT
price:
FREE!
homepage:
mg.pov.lt
license type:
GPL (GNU General Public License) 
developed by:
Marius Gedminas
category:
ROOT \ Programming \ Version Control
Eazysvn
Download Button

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Rate it!
What's New in This Release:
  • A somewhat better error message for ezswitch -c newbranch when eazysvn is unable to understand the branch structure (LP#446369).
  • ezswitch -t tagname; ezswitch branchname switches to a branch named branchname instead of trying to switch to a tag named branchname (LP#617888, fix by Wolfgang Schnerring).
read full changelog

Add your review!

SUBMIT