]> Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - README.mkd
Update README.mkd and documentation
[svn2svn.git] / README.mkd
1 svn2svn
2 =======
3 Replicate (replay) changesets from one Subversion repository to another.
4
5 Features
6 --------
7 - Meant for replaying history into an **empty** target location. This could be
8 an empty target repo or simply a brand-new folder/branch in the target repo.
9 - Maintains logical history (when possible), e.g. uses "svn copy" for renames.
10 - Maintains original commit messages.
11 - Optionally maintain source author info. (Only supported if target SVN
12 repo doesn't require auth, since this relies upon the `--username`
13 command-line arg.)
14 - **Note:** Cannot maintain original commit date, but appends original
15 commit date for each commit message: "Date: %d".
16 - Optionally run an external shell script before each replayed commit
17 to give the ability to dynamically exclude or modify files as part
18 of the replay.
19
20 Overview
21 --------
22 This is a utility for replicating the revision history from a source path in
23 a source SVN repository to a target path in a target SVN repository. In other
24 words, it "replays the history" of a given source SVN repository/branch/path
25 into a target SVN repository/branch/path.
26
27 This can be useful to create filtered version of a source SVN repository. For
28 example, say that you have a huge SVN repository with a _lot_ of old branch
29 history which is taking up a lot of disk-space and not serving a lot of purpose
30 going forward. You can this utility to replay/filter just the "/trunk" SVN
31 history into a new repository, so that things like "svn log" and "svn blame"
32 will still show the correct (logical) history/ancestry, even though we end-up
33 generating new commits which will have newer commit-dates and revision #'s.
34
35 Usage
36 -----
37 See `svn2svn.py --help`
38
39 Examples
40 --------
41 **Create a copy of only /trunk from source repo, starting at r5000**
42
43 $ svnadmin create /svn/target
44 $ svn mkdir -m 'Add trunk' file:///svn/target/trunk
45 $ svn2svn -av -r 5000 http://server/source/trunk file:///svn/target/trunk
46
47 1. The `target_url` will be checked-out to `./_wc_target`.
48 2. The first commit to `http://server/source/trunk` at/after r5000 will be
49 exported & added into `_wc_target`.
50 3. All revisions affecting `http://server/source/trunk` (starting at r5000)
51 will be replayed to `_wc_target`. Any add/copy/move/replaces that are
52 copy-from'd some path outside of /trunk (e.g. files renamed on a
53 /branch and branch was merged into /trunk) will correctly maintain
54 logical ancestry where possible.
55
56 **Use continue-mode (-c) to pick-up where the last run left-off**
57
58 $ svn2svn -avc http://server/source/trunk file:///svn/target/trunk
59
60 1. The `target_url` will be checked-out to `./_wc_target`, if not already
61 checked-out
62 2. All new revisions affecting `http://server/source/trunk` starting from
63 the last replayed revision to `file:///svn/target/trunk` (based on the
64 "`svn2svn:*`" revprops) will be replayed to `_wc_target`, maintaining all
65 logical ancestry where possible.
66
67 Credits
68 -------
69 This project borrows a lot of code from the "hgsvn" project. Many thanks to
70 the folks who have contributed to the hgsvn project, for writing code that is
71 easily re-usable:
72
73 * [http://pypi.python.org/pypi/hgsvn](http://pypi.python.org/pypi/hgsvn)
74 * [https://bitbucket.org/andialbrecht/hgsvn/overview](https://bitbucket.org/andialbrecht/hgsvn/overview)
75
76 This project was originally inspired by this "svn2svn" project:
77 [http://code.google.com/p/svn2svn/](http://code.google.com/p/svn2svn/)
78 That project didn't fully meet my needs, so I forked and ended-up rewriting
79 the majority of the code.