diff options
author | Modestas Vainius <modestas@vainius.eu> | 2011-04-24 22:46:23 +0300 |
---|---|---|
committer | Modestas Vainius <modestas@vainius.eu> | 2011-04-24 22:46:23 +0300 |
commit | c630dd763cf6ec096489bea551ca959540969c94 (patch) | |
tree | 64cfc7d592950bb22167892760aa74e322066042 /src/svn.cpp | |
parent | 197979b6a641b8b5fa4856c700b1235491c73a41 (diff) | |
download | svn2git-c630dd763cf6ec096489bea551ca959540969c94.tar svn2git-c630dd763cf6ec096489bea551ca959540969c94.tar.gz svn2git-c630dd763cf6ec096489bea551ca959540969c94.tar.bz2 svn2git-c630dd763cf6ec096489bea551ca959540969c94.tar.xz svn2git-c630dd763cf6ec096489bea551ca959540969c94.zip |
Support substitutions for repository/branch names.
This patch adds support for 's///' style substitutions for the
repository/branch names in the match rulesets. Useful when e.g. eliminating
characters not supported in git branch names.
Syntax:
match /...
repository some_repo
substitute repository s/pattern/replacement/
branch some_branch
substitute branch s/pattern/replacement/
end match
Diffstat (limited to 'src/svn.cpp')
-rw-r--r-- | src/svn.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/svn.cpp b/src/svn.cpp index 09495be..c103728 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -214,11 +214,17 @@ static void splitPathName(const Rules::Match &rule, const QString &pathName, QSt if (repository_p) { *repository_p = svnprefix; repository_p->replace(rule.rx, rule.repository); + foreach (Rules::Match::Substitution subst, rule.repo_substs) { + subst.apply(*repository_p); + } } if (branch_p) { *branch_p = svnprefix; branch_p->replace(rule.rx, rule.branch); + foreach (Rules::Match::Substitution subst, rule.branch_substs) { + subst.apply(*branch_p); + } } if (path_p) { |