From 4a0b046fc87a60bbbb037125a2eb31ae3548d34d Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Thu, 17 Jul 2014 17:03:39 +0200 Subject: init-repository: pass regexp in raw string to git log --grep This prevents python from escaping the special characters that resulted in git not finding the proper shasum for the git-svn-id regular expression line. Change-Id: Ic5449db6319b638cf692d2b4427ce5de7cbac66e Reviewed-by: Michael Bruning Reviewed-by: Adam Kallai --- tools/scripts/git_submodule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py index fa5e9691c..5376e877d 100644 --- a/tools/scripts/git_submodule.py +++ b/tools/scripts/git_submodule.py @@ -171,8 +171,8 @@ class Submodule: error = subprocessCall(['git', 'checkout', 'FETCH_HEAD']); if self.revision: - search_string = '\"git-svn-id: .*@' + str(self.revision) + '\"' - line = subprocessCheckOutput(['git', 'log', '-n1', '--pretty=oneline', '--grep=' + search_string]) + search_string = 'git-svn-id:.*@%d' % self.revision + line = subprocessCheckOutput(['git', 'log', '-n1', '--pretty=oneline', r'--grep=%s' % search_string]) if line: self.shasum = line.split()[0] -- cgit v1.2.3