Make simple revision merges and branch switching much easier
Eazysvn is a Python script that simplifies some common operations with Subversion branches.
- 1.15.0 (2018-04-13)
- 1.14.0 (2016-09-17)
- 1.13.0 (2015-01-13)
- 1.12.2 (2012-02-20)
- 1.12.1 (2010-09-14)
- 1.12.0 (2010-07-22)
- 1.11.0 (2009-05-26)
- 1.10.0 (2009-04-08)
- 1.9.0 (2008-08-08)
- 1.8.0 (2008-06-26)
- 1.7.0 (2008-06-11)
- 1.6.1 (2007-12-12)
- 1.6.0 (2007-12-11)
- 1.5.1 (2007-06-28)
- 1.5 (2007-06-28)
- 1.5 (2007-06-28)
- 1.4.1 (2007-06-20)
- 1.4.0 (2007-06-11)
- 1.3.1 (2007-04-04)
- 1.3 (2007-01-25)
- 1.2 (2007-01-16)
- 1.1 (2007-01-12)
- 1.0 (2006-08-23)
- Licensing and source code
- Wishlist/To do
Get it from the Python Package Index:
pip install eazysvn
You’ll need Python 2.7 or later, as well as the Subversion command-line client.
At the shell prompt type
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
In a subversion working directory run
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.
to switch to a branch, and
to switch back to trunk.
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.
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
After you’ve finished hacking on your branch, you will want to switch back to trunk and start merging. Run
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
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 bug fix 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
It’s like cherry-picking, but in reverse: you want to unapply changes already committed to this branch.
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`
All commands that require a branch name as an argument accept a -l (or –list) option that lists all branches, e.g.
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.
A revision to Subversion means the state of the whole project tree at a given instant of time. Sometimes the changeset that converts one revision to another is more interesting. When you specify a single number N to ezmerge, it assumes that you want to merge the changeset that changes revision (N-1) to revision N.
If you specify a range N-M, ezmerge.py merges all the changesets that change revision (N-1) to revision M. For compatibility with svn merge you can specify the revision range as N:M, and ezmerge will merge all the changesets that convert revision N to revision M. In the last case N can be greater than M, which is useful if you want to revert some changes, although ezrevert is more convenient for that.
When you specify ranges (N-M or N:M) M can be a special name HEAD. It means the latest revision in the repository.
You can also specify a special range ALL, which means all the changesets made in the branch. ezmerge will parse the output of svn log to get the revision numbers for you. ezmerge branchname is a shortcut for ezmerge ALL branchname.
For easier copying & pasting from svn log output, you can prefix numbers with the letter r, e.g. r1234.
Eazysvn expects you to use the traditional repository layout, and can find its way from any of these to any other of these URLs if you specify the desired branch name as ‘trunk’, ‘foo’, or ‘bar’.
scheme://server/path/to/svn/repo/trunk/subdirs scheme://server/path/to/svn/repo/branches/foo/subdirs scheme://server/path/to/svn/repo/branches/bar/subdirs
You do not have to be at the top of the project to switch or merge, any subdirectory will work. The part of your checkout above the current directory will not be touched by the merge/switch.
An alternative scheme is partially supported:
scheme://server/path/to/svn/repo/trunk/subdirs scheme://server/path/to/svn/repo/branch/foo/subdirs scheme://server/path/to/svn/repo/branch/bar/subdirs
Eazysvn will be able to find the location of trunk or other branches if you start out in a branch checkout, but it won’t be able to find your branches from a trunk checkout. This is a bug that should be fixed one day.
You can force eazysvn to use any nonstandard scheme if you explicitly enter the prefix with a slash in front of the branch name, e.g. ezswitch feature/foo in a trunk checkout would switch from
If you start out in a checkout of such a nonstandard location, Eazysvn won’t be able to find the location of trunk or other branches. This is a bug that should be fixed one day.
When you merge a branch (to trunk or to another branch), eazysvn uses svn log to find the revision number when the branch was created. Then it merges all the changes ever committed on that branch.
This means you usually can’t merge from the same branch more than once. It’s a consequence of Subversion’s lack of merge tracking.
Also, since there’s no fancy searching for common ancestors or anything like that, if you branch A from trunk make some changes, then branch B from branch A, make some changes, then if you ezmerge B on trunk, you won’t get any changes made in branch A.
When you merge a trunk to a branch, eazysvn again uses svn log to find the branch point and then merges all the changes made on trunk since that revision.
It’s a bad idea to merge from trunk to a branch, because then you won’t easily be able to merge that branch back to trunk. You may try, subversion might apply the already-applied changes twice cleanly, but it’s a matter of luck.
Keep it simple: always merge a branch only once, back to the same place you branched from, and you’ll avoid trouble. Remove branches you’ve merged to avoid accidentally making new changes that will be harder to merge.
- Add support for Python 3.6.
- Drop support for Python 3.3.
- 100% test coverage.
- Drop Python 2.6 and 3.2 support.
- Actually support Python 3.
- Flush output buffers before executing external commands. Previously if you did, e.g. eazysvn branchdiff > DIFF, you would see the output of svn diff above the svn diff command itself.
- Fix command alias handling on windows (https://github.com/mgedmin/eazysvn/pull/1) Patch by Timon Wong <email@example.com>.
- Support Python 3.
- New argument: ezmerge --accept=ARG, passed directly to subversion.
- Moved the source code from self-hosted Subversion to GitHub.
- 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).
- New option: ezmerge --reintegrate, passed straight to svn merge. Contributed by Wolfgang Schnerring <firstname.lastname@example.org>.
- Uses subprocess instead of os.popen2; no more deprecation warnings on Python 2.6.
- eazysvn tag accepts the -l (–list) option.
- ezbranch and ezswitch accept the -t option.
- New command: eazysvn branchpoint.
- You can refer to tags in all commands that accept branch names; use a branch named “tags/tagname”. This works for all kinds of prefixes, e.g. “obsolete-branches/branchname” etc.
- Nice PyPI documentation page with a changelog.
- New command: eazysvn tag.
- eazysvn --version prints the version number.
- New command: eazysvn branchdiff.
- ezmerge accepts the -l (–list) option.
- ezmerge branchname is short for ezmerge ALL branchname.
- ezmerge accepts the -d (–diff) option.
- ezrevert is short for eazysvn revert.
- New command: ezbranch, short for eazysvn branchurl.
- New command: ezbranch, short for eazysvn branchurl.
- Bugfix for eazysvn rmbranch.
- New command: eazysvn rmbranch.
- New command: eazysvn mvbranch.
- Make ezmerge ALL trunk useful: merge changes from the branch point of the current branch, not from the start of trunk.
- New command: eazysvn revert.
- First setuptools-based release, thanks to Philipp von Weitershausen.
- New command: eazysvn with four subcommands: merge (same as the old ezmerge command), switch (same as the old ezswitch command), help and selftest.
- New command: ezswitch.
- Changed ezmerge output format to be clearer.
- ezmerge now accepts ‘rXXX’ as revision numbers.
- ezmerge XXX:YYY treats the range as SVN-compatible
- ezmerge XXX-YYY is the new syntax for user-friendly inclusive ranges
- ezmerge ALL branchname figures out the appropriate revision numbers to merge all of the changes made in that branch.
- ezmerge now accepts -n (–dry-run) option.
- ezmerge now accepts -h (–help) and shows a help message.
- The original ezmerge.py by Philipp von Weitershausen.
Some of the dates before version 1.7.0 may be approximate, and the changes misattributed to the wrong revision.
Eazysvn is licensed under the GNU General Public Licence version 2 or later.
You can get the latest source code with
git clone https://github.com/mgedmin/eazysvn
ezmerge should accept a comma-separated list of revisions (1,2,4-6,9).
There should be eazysvn rmtag and eazysvn mvtag.
eazysvn help cmd should be the same as eazysvn cmd --help and not an error.
eazysvn -n cmd should be the same as eazysvn cmd -n and not an error.
eazysvn should do an svn ls to discover the branching scheme in use (‘branch’ or the more traditional ‘branches’).
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size eazysvn-1.15.0-py2.py3-none-any.whl (19.8 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size eazysvn-1.15.0.tar.gz (29.9 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for eazysvn-1.15.0-py2.py3-none-any.whl