]> Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - README.mkd
Update README for --keep-date and --keep-revnum support
[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 commit authors (`svn:author`). (*Requires non-authenticated
12 access to the target repo, since this relies upon the `--username` SVN
13 command-line arg.*)
14 - Optionally maintain source commit timestamps (`svn:date`). (*Requires a
15 "pre-revprop-change" hook script in the target repo, to be able to change
16 the "`svn:date`" revprops after target commits have been made.*)
17 - Optionally maintain identical revision #'s between source vs. target repo.
18 (*Effectively requires that you're replaying into an empty target repo,
19 or rather that the first source_url revision to be replayed is less than
20 the last target_url revision. Create blank "padding" revisions in the target
21 repo as needed.*)
22 - Optionally run an external shell script before each replayed commit
23 to give the ability to dynamically exclude or modify files as part
24 of the replay.
25
26 Overview
27 --------
28 This is a utility for replicating the revision history from a source path in
29 a source SVN repository to a target path in a target SVN repository. In other
30 words, it "replays the history" of a given source SVN repository/branch/path
31 into a target SVN repository/branch/path.
32
33 This can be useful to create filtered version of a source SVN repository. For
34 example, say that you have a huge SVN repository with a _lot_ of old branch
35 history which is taking up a lot of disk-space and not serving a lot of purpose
36 going forward. You can this utility to replay/filter just the "/trunk" SVN
37 history into a new repository, so that things like "svn log" and "svn blame"
38 will still show the correct (logical) history/ancestry, even though we end-up
39 generating new commits which will have newer commit-dates and revision #'s.
40
41 Usage
42 -----
43 See `svn2svn.py --help`
44
45 Examples
46 --------
47 **Create a copy of only /trunk from source repo, starting at r5000**
48
49 $ svnadmin create /svn/target
50 $ svn mkdir -m 'Add trunk' file:///svn/target/trunk
51 $ svn2svn -av -r 5000 http://server/source/trunk file:///svn/target/trunk
52
53 1. The `target_url` will be checked-out to `./_wc_target`.
54 2. The first commit to `http://server/source/trunk` at/after r5000 will be
55 exported & added into `_wc_target`.
56 3. All revisions affecting `http://server/source/trunk` (starting at r5000)
57 will be replayed to `_wc_target`. Any add/copy/move/replaces that are
58 copy-from'd some path outside of /trunk (e.g. files renamed on a
59 /branch and branch was merged into /trunk) will correctly maintain
60 logical ancestry where possible.
61
62 **Use continue-mode (-c) to pick-up where the last run left-off**
63
64 $ svn2svn -avc http://server/source/trunk file:///svn/target/trunk
65
66 1. The `target_url` will be checked-out to `./_wc_target`, if not already
67 checked-out
68 2. All new revisions affecting `http://server/source/trunk` starting from
69 the last replayed revision to `file:///svn/target/trunk` (based on the
70 "`svn2svn:*`" revprops) will be replayed to `_wc_target`, maintaining all
71 logical ancestry where possible.
72
73 Credits
74 -------
75 This project borrows a lot of code from the "hgsvn" project. Many thanks to
76 the folks who have contributed to the hgsvn project, for writing code that is
77 easily re-usable:
78
79 * [http://pypi.python.org/pypi/hgsvn](http://pypi.python.org/pypi/hgsvn)
80 * [https://bitbucket.org/andialbrecht/hgsvn/overview](https://bitbucket.org/andialbrecht/hgsvn/overview)
81
82 This project was originally inspired by this "svn2svn" project:
83 [http://code.google.com/p/svn2svn/](http://code.google.com/p/svn2svn/)
84 That project didn't fully meet my needs, so I forked and ended-up rewriting
85 the majority of the code.
86
87 Links
88 -----
89 * Introduction: "**[svn2svn: Replaying SVN History](http://nynim.org/blog/2012/02/01/svn2svn-replaying-svn-history/)**"
90 * Project page: [http://nynim.org/projects/svn2svn](http://nynim.org/projects/svn2svn)
91 * Source code @ Github: [https://github.com/tonyduckles/svn2svn](https://github.com/tonyduckles/svn2svn)
92 * Source code @ git.nynim.org [http://git.nynim.org/svn2svn.git](http://git.nynim.org/svn2svn.git)