From c630dd763cf6ec096489bea551ca959540969c94 Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Sun, 24 Apr 2011 22:46:23 +0300 Subject: 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 --- src/svn.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/svn.cpp') 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) { -- cgit v1.2.1