Ejemplo n.º 1
0
    def process(self):
        if not self.__gitflow.is_release():
            raise NoBranchSelected('Checkout to release branch before')

        if not self.__git.is_clean_working_tree():
            raise NotCleanWorkingTree()

        self.__pull_master()

        if self.__git.is_branch_ahead(self.__config_handler.master(),
                                      self.__name):
            Log.error("""

            {fg_fail}{list}{reset_fg}

                        """.format(
                fg_fail=Fg.FAIL.value,
                list=self.__git.list_commit_diff(
                    self.__config_handler.master(), self.__name),
                reset_fg=Fg.RESET.value,
            ))
            self.__checkout_current_release()

            raise BranchHaveDiverged("""
    
    {fg_fail}{message}{reset_fg}
    
                            """.format(
                fg_fail=Fg.FAIL.value,
                message='Oups !!! Master:' + self.__config_handler.master() +
                ' have commit ahead ' + self.__name + ' merge before',
                reset_fg=Fg.RESET.value,
            ))

        self.__pull_develop().__finish_release()
Ejemplo n.º 2
0
    def process(self):
        if not self.__git.is_clean_working_tree():
            raise NotCleanWorkingTree()
        if not self.__gitflow.is_feature():
            raise BranchNotExist(self.__config_handler.feature())

        self.__pull_develop()
        if self.__git.is_branch_ahead(self.__config_handler.develop(),
                                      self.__current_branch_name):
            Log.error("""

{fg_fail}{list}{reset_fg}

            """.format(
                fg_fail=Fg.FAIL.value,
                list=self.__git.list_commit_diff(
                    self.__config_handler.develop(),
                    self.__current_branch_name),
                reset_fg=Fg.RESET.value,
            ))
            self.__checkout_current_feature()
            raise BranchHaveDiverged("""
    
{fg_fail}{message}{reset_fg}
    
                            """.format(
                fg_fail=Fg.FAIL.value,
                message='Oups !!! Develop have commit ahead ' +
                self.__current_branch_name + ' merge before',
                reset_fg=Fg.RESET.value,
            ))

        self.__finish_feature()
Ejemplo n.º 3
0
    def __start_check(self):
        #  TODO recheck local vs remote
        # if self.__git.has_remote() and not self.__git.is_local_remote_equal(Branches.DEVELOP.value):
        #     raise RemoteDivergence(Branches.DEVELOP.value)

        if not self.__git.is_clean_working_tree():
            raise NotCleanWorkingTree('Stash or commit your changes !!!')

        if self.__gitflow.has_release(True) or self.__gitflow.has_release(
                False):
            raise BranchAlreadyExist(self.__config_handler.release())

        if self.__gitflow.has_hotfix(True) or self.__gitflow.has_hotfix(False):
            raise BranchAlreadyExist(self.__config_handler.release())
Ejemplo n.º 4
0
 def process(self):
     if not self.__git.is_clean_working_tree():
         raise NotCleanWorkingTree()
     self.__init_gitflow().__pull_develop().__pull_master().__start_hotfix()
Ejemplo n.º 5
0
 def process(self):
     self.__init_gitflow()
     if not self.__git.is_clean_working_tree():
         raise NotCleanWorkingTree()
     self.__init_develop()