示例#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
    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)