Chromium Code Reviews| Index: git_cl/git_cl.py |
| =================================================================== |
| --- git_cl/git_cl.py (revision 70912) |
| +++ git_cl/git_cl.py (working copy) |
| @@ -29,6 +29,9 @@ |
| DEFAULT_SERVER = 'http://codereview.appspot.com' |
| PREDCOMMIT_HOOK = '.git/hooks/pre-cl-dcommit' |
| +POSTUPSTREAM_HOOK_PATTERN = '.git/hooks/post-cl-%s' |
|
M-A Ruel
2011/01/10 19:22:08
I think you should remove POSTDCOMMIT_HOOK and POS
sadrul
2011/01/10 19:27:50
Done.
|
| +POSTDCOMMIT_HOOK = POSTUPSTREAM_HOOK_PATTERN % 'dcommit' |
| +POSTPUSH_HOOK = POSTUPSTREAM_HOOK_PATTERN % 'push' |
| PREUPLOAD_HOOK = '.git/hooks/pre-cl-upload' |
| DESCRIPTION_BACKUP_FILE = '~/.git_cl_description_backup' |
| @@ -973,6 +976,7 @@ |
| # Stuff our change into the merge branch. |
| # We wrap in a try...finally block so if anything goes wrong, |
| # we clean up the branches. |
| + retcode = -1 |
| try: |
| RunGit(['checkout', '-q', '-b', MERGE_BRANCH, base_branch]) |
| RunGit(['merge', '--squash', cl.GetBranchRef()]) |
| @@ -988,7 +992,7 @@ |
| logging.debug(output) |
| else: |
| # dcommit the merge branch. |
| - output = RunGit(['svn', 'dcommit', '--no-rebase']) |
| + retcode, output = RunGitWithCode(['svn', 'dcommit', '--no-rebase']) |
| finally: |
| # And then swap back to the original branch and clean up. |
| RunGit(['checkout', '-q', cl.GetBranch()]) |
| @@ -1008,6 +1012,12 @@ |
| '(you may be prompted for your codereview password)...') |
| cl.CloseIssue() |
| cl.SetIssue(0) |
| + |
| + if retcode == 0: |
| + hook = POSTUPSTREAM_HOOK_PATTERN % cmd |
| + if os.path.isfile(hook): |
| + RunHook(hook, upstream_branch=base_branch, error_ok=True) |
| + |
| return 0 |