From 409d8bc4cbaade82672f251c45178c3cfed4619d Mon Sep 17 00:00:00 2001 From: Torgny Nyblom Date: Tue, 21 Dec 2010 14:49:54 +0100 Subject: Add option for using the real content of an SVN branch when creating a new branch instead of using the contents of the git "from" branch. --- src/main.cpp | 1 + src/svn.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index e6a2bfa..3a41356 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -106,6 +106,7 @@ static const CommandLineOption options[] = { {"--debug-rules", "print what rule is being used for each file"}, {"--commit-interval NUMBER", "if passed the cache will be flushed to git every NUMBER of commits"}, {"--stats", "after a run print some statistics about the rules"}, + {"--svn-branches", "Use the contents of SVN when creating branches, Note: SVN tags are branches as well"}, {"-h, --help", "show help"}, {"-v, --version", "show version"}, CommandLineLastOption diff --git a/src/svn.cpp b/src/svn.cpp index 5a61556..622380f 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -730,6 +730,21 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha if (repo->createBranch(branch, revnum, prevbranch, rev_from) == EXIT_FAILURE) return EXIT_FAILURE; + + Repository::Transaction *txn = transactions.value(repository + branch, 0); + if (!txn) { + txn = repo->newTransaction(branch, svnprefix, revnum); + if (!txn) + return EXIT_FAILURE; + + transactions.insert(repository + branch, txn); + } + if(CommandLineParser::instance()->contains("svn-branches")) { + if(ruledebug) + qDebug() << "Create a true SVN copy of branch (" << key << "->" << branch << path << ")"; + txn->deleteFile(path); + recursiveDumpDir(txn, fs_root, key, path, pool); + } if (rule.annotate) { // create an annotated tag fetchRevProps(); -- cgit v1.2.1