##// END OF EJS Templates
vcs-settings: when setting landing ref from UI switch default GIT branch too....
super-admin -
r4753:515e2e65 default
parent child
Show More
@@ -467,6 +467,9 class RepoModel(BaseModel):
467 RepoModel().grant_user_permission(
467 RepoModel().grant_user_permission(
468 repo=cur_repo, user=User.DEFAULT_USER, perm=EMPTY_PERM
468 repo=cur_repo, user=User.DEFAULT_USER, perm=EMPTY_PERM
469 )
469 )
470 if kwargs.get('repo_landing_rev'):
471 landing_rev_val = kwargs['repo_landing_rev']
472 RepoModel().set_landing_rev(cur_repo, landing_rev_val)
470
473
471 # handle extra fields
474 # handle extra fields
472 for field in filter(lambda k: k.startswith(RepositoryField.PREFIX), kwargs):
475 for field in filter(lambda k: k.startswith(RepositoryField.PREFIX), kwargs):
@@ -933,6 +936,12 class RepoModel(BaseModel):
933 if field:
936 if field:
934 self.sa.delete(field)
937 self.sa.delete(field)
935
938
939 def set_landing_rev(self, repo, landing_rev_name):
940 if landing_rev_name.startswith('branch:'):
941 landing_rev_name = landing_rev_name.split('branch:')[-1]
942 scm_instance = repo.scm_instance()
943 return scm_instance._remote.set_head_ref(landing_rev_name)
944
936 def _create_filesystem_repo(self, repo_name, repo_type, repo_group,
945 def _create_filesystem_repo(self, repo_name, repo_type, repo_group,
937 clone_uri=None, repo_store_location=None,
946 clone_uri=None, repo_store_location=None,
938 use_global_config=False, install_hooks=True):
947 use_global_config=False, install_hooks=True):
General Comments 0
You need to be logged in to leave comments. Login now