##// 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 876 shadow_repo._local_merge(merge_message, merger_name, merger_email,
877 877 [source_ref.commit_id])
878 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 889 except RepositoryError as e:
880 890 log.exception('Failure when doing local merge on git shadow repo')
881 891 merge_possible = False
@@ -887,10 +897,6 b' class GitRepository(BaseRepository):'
887 897 pr_branch, self.path, target_ref.name, enable_hooks=True,
888 898 rc_scm_data=self.config.get('rhodecode', 'RC_SCM_DATA'))
889 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 900 except RepositoryError as e:
895 901 log.exception(
896 902 'Failure when doing local push on git shadow repo')
General Comments 0
You need to be logged in to leave comments. Login now