OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 footers[m.group(1)] = m.group(2).strip() | 73 footers[m.group(1)] = m.group(2).strip() |
74 return footers | 74 return footers |
75 | 75 |
76 | 76 |
77 class GitFailedException(Exception): | 77 class GitFailedException(Exception): |
78 pass | 78 pass |
79 | 79 |
80 | 80 |
81 def Strip(f): | 81 def Strip(f): |
82 def new_f(*args, **kwargs): | 82 def new_f(*args, **kwargs): |
83 return f(*args, **kwargs).strip() | 83 result = f(*args, **kwargs) |
| 84 if result is None: |
| 85 return result |
| 86 else: |
| 87 return result.strip() |
84 return new_f | 88 return new_f |
85 | 89 |
86 | 90 |
87 def MakeArgs(l): | 91 def MakeArgs(l): |
88 """['-a', '', 'abc', ''] -> '-a abc'""" | 92 """['-a', '', 'abc', ''] -> '-a abc'""" |
89 return " ".join(filter(None, l)) | 93 return " ".join(filter(None, l)) |
90 | 94 |
91 | 95 |
92 def Quoted(s): | 96 def Quoted(s): |
93 return "\"%s\"" % s | 97 return "\"%s\"" % s |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 def GitSVNFindSVNRev(self, git_hash, branch="", **kwargs): | 309 def GitSVNFindSVNRev(self, git_hash, branch="", **kwargs): |
306 return self.Git(MakeArgs(["svn find-rev", git_hash, branch]), **kwargs) | 310 return self.Git(MakeArgs(["svn find-rev", git_hash, branch]), **kwargs) |
307 | 311 |
308 def GitSVNDCommit(self, **kwargs): | 312 def GitSVNDCommit(self, **kwargs): |
309 return self.Git("svn dcommit 2>&1", retry_on=lambda x: x is None, **kwargs) | 313 return self.Git("svn dcommit 2>&1", retry_on=lambda x: x is None, **kwargs) |
310 | 314 |
311 def GitSVNTag(self, version, **kwargs): | 315 def GitSVNTag(self, version, **kwargs): |
312 self.Git(("svn tag %s -m \"Tagging version %s\"" % (version, version)), | 316 self.Git(("svn tag %s -m \"Tagging version %s\"" % (version, version)), |
313 retry_on=lambda x: x is None, | 317 retry_on=lambda x: x is None, |
314 **kwargs) | 318 **kwargs) |
OLD | NEW |