]> asedeno.scripts.mit.edu Git - git-svn-keywords.git/commitdiff
call sub on re objects
authorAlejandro R. Sedeño <asedeno@mit.edu>
Fri, 27 Aug 2010 18:26:35 +0000 (14:26 -0400)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Fri, 27 Aug 2010 18:26:35 +0000 (14:26 -0400)
git-svn-keywords.py

index f3fddb84a56145730a862c1d9aef138f9725cd7e..1bbc494d388a1f4ab4cc2295673925b7755da6f2 100755 (executable)
@@ -252,15 +252,15 @@ def smudge(g, options):
             for sk in svn_keywords:
                 if k in svn_keywords[sk]:
                     if options.clean:
-                        buf = re.sub(get_svn_keyword_re(sk), '$\\1$', buf)
+                        buf = get_svn_keyword_re(sk).sub('$\\1$', buf)
                     elif sk == 'Id':
                         id_str = ' '.join([info_dict['Name'],
                                            info_dict['Revision'],
                                            info_dict['Date'],
                                            info_dict['Author']])
-                        buf = re.sub(get_svn_keyword_re(sk), '$\\1: ' + id_str + ' $', buf)
+                        buf = get_svn_keyword_re(sk).sub('$\\1: ' + id_str + ' $', buf)
                     else:
-                        buf = re.sub(get_svn_keyword_re(sk), '$\\1: ' + info_dict[sk] + ' $', buf)
+                        buf = get_svn_keyword_re(sk).sub('$\\1: ' + info_dict[sk] + ' $', buf)
 
         with open(os.path.join(g.wd, path), 'w') as f:
             f.write(buf)