#!/bin/sh # # Use this script to generate branches.svndump # mkdir temp cd temp mkdir project-orig cd project-orig mkdir trunk mkdir branches cd .. svnadmin create svn-repo global svnurl := "file://$[pwd]/svn-repo" svn import project-orig $svnurl -m "init projA" svn co $svnurl project cd project echo a > trunk/a echo b > trunk/b echo c > trunk/c mkdir trunk/dir echo e > trunk/dir/e # Add a file within branches, used to confuse branch detection echo d > branches/notinbranch svn add trunk/a trunk/b trunk/c trunk/dir branches/notinbranch svn ci -m hello svn up # Branch to old svn copy trunk branches/old svn rm branches/old/c svn rm branches/old/dir svn ci -m "branch trunk, remove c and dir" svn up # Update trunk echo a >> trunk/a svn ci -m "change a" # Update old branch echo b >> branches/old/b svn ci -m "change b" # Create a cross-branch revision svn move trunk/b branches/old/c echo c >> branches/old/c svn ci -m "move and update c" # Update old branch again echo b >> branches/old/b svn ci -m "change b again" # Move back and forth between branch of similar names # This used to generate fake copy records svn up svn move branches/old branches/old2 svn ci -m "move to old2" svn move branches/old2 branches/old svn ci -m "move back to old" # Update trunk again echo a > trunk/a svn ci -m "last change to a" # Branch again from a converted revision svn copy -r 1 $svnurl/trunk branches/old3 svn ci -m "branch trunk@1 into old3" cd .. svnadmin dump svn-repo > ../branches.svndump (CommandList children: [ (C {(mkdir)} {(temp)}) (C {(cd)} {(temp)}) (C {(mkdir)} {(project-orig)}) (C {(cd)} {(project-orig)}) (C {(mkdir)} {(trunk)}) (C {(mkdir)} {(branches)}) (C {(cd)} {(..)}) (C {(svnadmin)} {(create)} {(svn-repo)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:svnurl) op: Equal rhs: {(file) (Lit_Other ":") (//) (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: spids: [53 55] ) (/svn-repo) } spids: [49] ) ] spids: [49] ) (C {(svn)} {(import)} {(project-orig)} {($ VSub_Name "$svnurl")} {(-m)} {(DQ ("init projA"))}) (C {(svn)} {(co)} {($ VSub_Name "$svnurl")} {(project)}) (C {(cd)} {(project)}) (SimpleCommand words: [{(echo)} {(a)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(trunk/a)} spids:[89])] ) (SimpleCommand words: [{(echo)} {(b)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(trunk/b)} spids:[97])] ) (SimpleCommand words: [{(echo)} {(c)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(trunk/c)} spids:[105])] ) (C {(mkdir)} {(trunk/dir)}) (SimpleCommand words: [{(echo)} {(e)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(trunk/dir/e)} spids:[117])] ) (SimpleCommand words: [{(echo)} {(d)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(branches/notinbranch)} spids:[128])] ) (C {(svn)} {(add)} {(trunk/a)} {(trunk/b)} {(trunk/c)} {(trunk/dir)} {(branches/notinbranch)}) (C {(svn)} {(ci)} {(-m)} {(hello)}) (C {(svn)} {(up)}) (C {(svn)} {(copy)} {(trunk)} {(branches/old)}) (C {(svn)} {(rm)} {(branches/old/c)}) (C {(svn)} {(rm)} {(branches/old/dir)}) (C {(svn)} {(ci)} {(-m)} {(DQ ("branch trunk, remove c and dir"))}) (C {(svn)} {(up)}) (SimpleCommand words: [{(echo)} {(a)}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(trunk/a)} spids:[204])] ) (C {(svn)} {(ci)} {(-m)} {(DQ ("change a"))}) (SimpleCommand words: [{(echo)} {(b)}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(branches/old/b)} spids:[226])] ) (C {(svn)} {(ci)} {(-m)} {(DQ ("change b"))}) (C {(svn)} {(move)} {(trunk/b)} {(branches/old/c)}) (SimpleCommand words: [{(echo)} {(c)}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(branches/old/c)} spids:[256])] ) (C {(svn)} {(ci)} {(-m)} {(DQ ("move and update c"))}) (SimpleCommand words: [{(echo)} {(b)}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(branches/old/b)} spids:[278])] ) (C {(svn)} {(ci)} {(-m)} {(DQ ("change b again"))}) (C {(svn)} {(up)}) (C {(svn)} {(move)} {(branches/old)} {(branches/old2)}) (C {(svn)} {(ci)} {(-m)} {(DQ ("move to old2"))}) (C {(svn)} {(move)} {(branches/old2)} {(branches/old)}) (C {(svn)} {(ci)} {(-m)} {(DQ ("move back to old"))}) (SimpleCommand words: [{(echo)} {(a)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(trunk/a)} spids:[347])] ) (C {(svn)} {(ci)} {(-m)} {(DQ ("last change to a"))}) (C {(svn)} {(copy)} {(-r)} {(1)} {($ VSub_Name "$svnurl") (/trunk)} {(branches/old3)}) (C {(svn)} {(ci)} {(-m)} {(DQ ("branch trunk@1 into old3"))}) (C {(cd)} {(..)}) (SimpleCommand words: [{(svnadmin)} {(dump)} {(svn-repo)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(../branches.svndump)} spids:[399])] ) ] )