mathlibtools/lib.py
def pr(self, branch_name: str, force: bool = False) -> None:
        """
        Prepare to work on a mathlib pull-request on a new branch.
        This will check for a clean working copy unless force is True.
        """
        if self.is_dirty and not force:
            raise LeanDirtyRepo
        if not self.is_mathlib:
            raise LeanProjectError('This operation is for mathlib only.')
        if not self.repo:
            raise LeanProjectError('This project has no git repository.')
        if branch_name in self.repo.branches: # type: ignore
            raise LeanProjectError(f'The branch {branch_name} already exists, '
                                    'please choose another name.')
        log.info('Checking out master...')
        self.repo.git.checkout('master')
        origin = self.repo.remote().name
        self.upgrade_mathlib()
        log.info('Checking out new branch...')
        self.repo.git.checkout('-b', branch_name)
        log.info(f'Setting remote tracking to {origin}...')
        rem_ref = RemoteReference(self.repo,
                                  f"refs/remotes/{origin}/{branch_name}")
        self.repo.head.reference.set_tracking_branch(rem_ref)
        log.info('Done.')

        Prepare to work on a mathlib pull-request on a new branch.
        This will check for a clean working copy unless force is True.
        
Prepare to work on a mathlib pull-request on a new branch.
This will check for a clean working copy unless force is True.
Prepare to work on a mathlib pull - request on a new branch . This will check for a clean working copy unless force is True .
def pr(self, branch_name: str, force: bool = False) -> None:
        if self.is_dirty and not force:
            raise LeanDirtyRepo
        if not self.is_mathlib:
            raise LeanProjectError('This operation is for mathlib only.')
        if not self.repo:
            raise LeanProjectError('This project has no git repository.')
        if branch_name in self.repo.branches: 
            raise LeanProjectError(f'The branch {branch_name} already exists, '
                                    'please choose another name.')
        log.info('Checking out master...')
        self.repo.git.checkout('master')
        origin = self.repo.remote().name
        self.upgrade_mathlib()
        log.info('Checking out new branch...')
        self.repo.git.checkout('-b', branch_name)
        log.info(f'Setting remote tracking to {origin}...')
        rem_ref = RemoteReference(self.repo,
                                  f"refs/remotes/{origin}/{branch_name}")
        self.repo.head.reference.set_tracking_branch(rem_ref)
        log.info('Done.')
def pr ( self , branch_name : str , force : bool = False ) -> None : if self . is_dirty and not force : raise LeanDirtyRepo if not self . is_mathlib : raise LeanProjectError ( 'This operation is for mathlib only.' ) if not self . repo : raise LeanProjectError ( 'This project has no git repository.' ) if branch_name in self . repo . branches : raise LeanProjectError ( f'The branch {branch_name} already exists, ' 'please choose another name.' ) log . info ( 'Checking out master...' ) self . repo . git . checkout ( 'master' ) origin = self . repo . remote ( ) . name self . upgrade_mathlib ( ) log . info ( 'Checking out new branch...' ) self . repo . git . checkout ( '-b' , branch_name ) log . info ( f'Setting remote tracking to {origin}...' ) rem_ref = RemoteReference ( self . repo , f"refs/remotes/{origin}/{branch_name}" ) self . repo . head . reference . set_tracking_branch ( rem_ref ) log . info ( 'Done.' )
Prepare to work on a mathlib pull-request on a new branch.
Prepare to work on a mathlib pull - request on a new branch .
"""
        Prepare to work on a mathlib pull-request on a new branch.
        This will check for a clean working copy unless force is True.
        """ # type: ignore
self
branch_name
str
force
bool