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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 | 99 |
100 class GitRecipesMixin(object): | 100 class GitRecipesMixin(object): |
101 def GitIsWorkdirClean(self, **kwargs): | 101 def GitIsWorkdirClean(self, **kwargs): |
102 return self.Git("status -s -uno", **kwargs).strip() == "" | 102 return self.Git("status -s -uno", **kwargs).strip() == "" |
103 | 103 |
104 @Strip | 104 @Strip |
105 def GitBranch(self, **kwargs): | 105 def GitBranch(self, **kwargs): |
106 return self.Git("branch", **kwargs) | 106 return self.Git("branch", **kwargs) |
107 | 107 |
108 def GitCreateBranch(self, name, branch="", **kwargs): | 108 def GitCreateBranch(self, name, remote="", **kwargs): |
109 assert name | 109 assert name |
110 self.Git(MakeArgs(["checkout -b", name, branch]), **kwargs) | 110 remote_args = ["--upstream", remote] if remote else [] |
| 111 self.Git(MakeArgs(["new-branch", name] + remote_args), **kwargs) |
111 | 112 |
112 def GitDeleteBranch(self, name, **kwargs): | 113 def GitDeleteBranch(self, name, **kwargs): |
113 assert name | 114 assert name |
114 self.Git(MakeArgs(["branch -D", name]), **kwargs) | 115 self.Git(MakeArgs(["branch -D", name]), **kwargs) |
115 | 116 |
116 def GitReset(self, name, **kwargs): | 117 def GitReset(self, name, **kwargs): |
117 assert name | 118 assert name |
118 self.Git(MakeArgs(["reset --hard", name]), **kwargs) | 119 self.Git(MakeArgs(["reset --hard", name]), **kwargs) |
119 | 120 |
120 def GitStash(self, **kwargs): | 121 def GitStash(self, **kwargs): |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 def GitSVNFindSVNRev(self, git_hash, branch="", **kwargs): | 310 def GitSVNFindSVNRev(self, git_hash, branch="", **kwargs): |
310 return self.Git(MakeArgs(["svn find-rev", git_hash, branch]), **kwargs) | 311 return self.Git(MakeArgs(["svn find-rev", git_hash, branch]), **kwargs) |
311 | 312 |
312 def GitSVNDCommit(self, **kwargs): | 313 def GitSVNDCommit(self, **kwargs): |
313 return self.Git("svn dcommit 2>&1", retry_on=lambda x: x is None, **kwargs) | 314 return self.Git("svn dcommit 2>&1", retry_on=lambda x: x is None, **kwargs) |
314 | 315 |
315 def GitSVNTag(self, version, **kwargs): | 316 def GitSVNTag(self, version, **kwargs): |
316 self.Git(("svn tag %s -m \"Tagging version %s\"" % (version, version)), | 317 self.Git(("svn tag %s -m \"Tagging version %s\"" % (version, version)), |
317 retry_on=lambda x: x is None, | 318 retry_on=lambda x: x is None, |
318 **kwargs) | 319 **kwargs) |
OLD | NEW |