Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index 244259df3d5b8876c9e353b4d066dcabdba79ba3..a1889cef4b9cf8fbabb732af3a1dea136aa3aa9b 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -39,6 +39,7 @@ DEFAULT_SERVER = 'https://codereview.appspot.com' |
| POSTUPSTREAM_HOOK_PATTERN = '.git/hooks/post-cl-%s' |
| DESCRIPTION_BACKUP_FILE = '~/.git_cl_description_backup' |
| GIT_INSTRUCTIONS_URL = 'http://code.google.com/p/chromium/wiki/UsingNewGit' |
| +CHANGE_ID_STR = 'Change-Id:' |
| # Initialized in main() |
| @@ -987,6 +988,10 @@ def CMDpresubmit(parser, args): |
| author=None) |
| return 0 |
| +def AddChangeIdToCommitMessage(message): |
|
cmp
2012/10/19 23:47:08
insert an empty line before line 991
Siva Chandra
2012/10/20 00:31:24
Done.
|
| + git_command = ['commit', '-a', '--amend', '-m %s' % message] |
|
cmp
2012/10/19 23:47:08
I'm surprised this works. I expect the list to ne
M-A Ruel
2012/10/20 00:01:39
Chase is right. In addition, using the -a flag mea
Siva Chandra
2012/10/20 00:31:24
Done.
Siva Chandra
2012/10/20 00:31:24
Done.
|
| + RunGit(git_command) |
| + print "git-cl: Added Change-Id to commit message." |
|
cmp
2012/10/19 23:47:08
before line 994, can we add a line that gets the n
Siva Chandra
2012/10/20 00:31:24
Done.
|
| def GerritUpload(options, args, cl): |
|
cmp
2012/10/19 23:47:08
insert an empty line before line 996
Siva Chandra
2012/10/20 00:31:24
Done.
|
| """upload the current branch to gerrit.""" |
| @@ -998,6 +1003,8 @@ def GerritUpload(options, args, cl): |
| branch = options.target_branch |
| log_desc = options.message or CreateDescriptionFromLog(args) |
| + if not re.search(CHANGE_ID_STR, log_desc): |
|
M-A Ruel
2012/10/20 00:01:39
you probably want:
if CHANGE_ID_STR not in log_des
Siva Chandra
2012/10/20 00:31:24
Done.
|
| + AddChangeIdToCommitMessage(log_desc) |
| if options.reviewers: |
| log_desc += '\nR=' + options.reviewers |
| change_desc = ChangeDescription(log_desc, options.reviewers) |