예제 #1
0
파일: repo.py 프로젝트: Kclubs/walle-web
 def checkout_2_commit(self, branch, commit):
     '''
     @todo 未完成
     @param branch:
     @param commit:
     @return:
     '''
     PyRepo(self.path).git.checkout(branch)
     # PyRepo(self.path).head.set_reference(branch)
     # 方法有问题,只是做了reset,没有checkout
     PyRepo(self.path).head.set_commit(commit)
예제 #2
0
파일: repo.py 프로젝트: tuantuan5420/wali
    def checkout_2_tag(self, tag):
        '''
        切换到tag

        @param tag:
        @return:
        '''
        PyRepo(self.path).git.checkout(tag)
예제 #3
0
파일: repo.py 프로젝트: tuantuan5420/wali
    def checkout_2_branch(self, branch):
        '''
        切换到某个分支

        @param branch:
        @return:
        '''
        PyRepo(self.path).git.checkout(branch)
예제 #4
0
파일: repo.py 프로젝트: tuantuan5420/wali
    def tags(self):
        '''
        获取所有tag,按时间倒序

        @param branch:
        @param kwargs:
        @return:
        '''
        return [str(tag) for tag in PyRepo(self.path).tags][-10:]
예제 #5
0
파일: repo.py 프로젝트: tuantuan5420/wali
    def checkout_2_commit(self, branch, commit):
        '''
        切换分支的某个commit

        @param branch:
        @param commit:
        @return:
        '''
        self.checkout_2_branch(branch=branch)
        PyRepo(self.path).git.reset('--hard', commit)
예제 #6
0
파일: repo.py 프로젝트: tuantuan5420/wali
    def pull(self):
        '''
        更新项目

        @param branch:
        @param kwargs:
        @return:
        '''
        repo = PyRepo(self.path)

        return repo.remote().pull()
예제 #7
0
파일: repo.py 프로젝트: XiuyeXYE/walle-web
    def branches(self):
        '''
        获取所有分支

        @param branch:
        @param kwargs:
        @return:
        '''
        # 去除 origin/HEAD -> 当前指向
        # 去除远端前缀
        branches = PyRepo(self.path).remote().refs
        # fixbug https://github.com/meolu/walle-web/issues/705
        return [str(branch).strip().lstrip('origin').lstrip('/') for branch in branches if
                not str(branch).strip().startswith('origin/HEAD')]
예제 #8
0
파일: repo.py 프로젝트: Kclubs/walle-web
 def checkout_2_tag(self, tag):
     PyRepo(self.path).git.checkout(tag)
예제 #9
0
파일: repo.py 프로젝트: Kclubs/walle-web
 def checkout_2_branch(self, branch):
     PyRepo(self.path).git.checkout(branch)
예제 #10
0
 def checkout_2_commit(self, branch, commit):
     PyRepo(self.path).head.set_reference(branch)
     PyRepo(self.path).head.set_commit(commit)