##// END OF EJS Templates
pr-shadow: Set reference in git shadow repositories on successful merge. #1055
Martin Bornhold -
r1039:57a326c4 default
parent child Browse files
Show More
@@ -876,6 +876,16 b' class GitRepository(BaseRepository):'
876 shadow_repo._local_merge(merge_message, merger_name, merger_email,
876 shadow_repo._local_merge(merge_message, merger_name, merger_email,
877 [source_ref.commit_id])
877 [source_ref.commit_id])
878 merge_possible = True
878 merge_possible = True
879
880 # Need to reload repo to invalidate the cache, or otherwise we
881 # cannot retrieve the merge commit.
882 shadow_repo = GitRepository(shadow_repository_path)
883 merge_commit_id = shadow_repo.branches[pr_branch]
884
885 # Set a reference pointing to the merge commit. This reference may
886 # be used to easily identify the last successful merge commit in
887 # the shadow repository.
888 shadow_repo.set_refs('refs/heads/pr-merge', merge_commit_id)
879 except RepositoryError as e:
889 except RepositoryError as e:
880 log.exception('Failure when doing local merge on git shadow repo')
890 log.exception('Failure when doing local merge on git shadow repo')
881 merge_possible = False
891 merge_possible = False
@@ -887,10 +897,6 b' class GitRepository(BaseRepository):'
887 pr_branch, self.path, target_ref.name, enable_hooks=True,
897 pr_branch, self.path, target_ref.name, enable_hooks=True,
888 rc_scm_data=self.config.get('rhodecode', 'RC_SCM_DATA'))
898 rc_scm_data=self.config.get('rhodecode', 'RC_SCM_DATA'))
889 merge_succeeded = True
899 merge_succeeded = True
890 # Need to reload repo to invalidate the cache, or otherwise we
891 # cannot retrieve the merge commit.
892 shadow_repo = GitRepository(shadow_repository_path)
893 merge_commit_id = shadow_repo.branches[pr_branch]
894 except RepositoryError as e:
900 except RepositoryError as e:
895 log.exception(
901 log.exception(
896 'Failure when doing local push on git shadow repo')
902 'Failure when doing local push on git shadow repo')
General Comments 0
You need to be logged in to leave comments. Login now