Exemple #1
0
 def init(self):
     """ Creates a new git repository. """
     self._chdir()
     utils.silence(
         subprocess.call,
         ('E:/Program Files/Git/bin/git.exe', 'init')
     )
Exemple #2
0
 def clone_from(self, source_path):
     """ Clone the repository to the destination path """
     # Will raise an exception if unsuccessful
     utils.silence(
         subprocess.check_call,
         ('E:/Program Files/Git/bin/git.exe', 'clone', source_path, self.repo_path)
     )
     return True
Exemple #3
0
 def push(self):
     utils.silence(
         subprocess.call,
         (
             'E:/Program Files/Git/bin/git.exe',
             'push'
         ),
     )
Exemple #4
0
 def checkout(self,branch):
     utils.silence(
         subprocess.call,
         (
             'E:/Program Files/Git/bin/git.exe',
             'checkout',
             branch,
         )
     )
Exemple #5
0
 def commit(self, author, message):
     """ Perform the commit """
     # NOTE: user format: 'Lyndsy Simon <*****@*****.**'
     utils.silence(
         subprocess.call,
         (
             'E:/Program Files/Git/bin/git.exe',
             'commit',
             '--author="{}"'.format(author),
             '-m "{}"'.format(message)
         ),
     )
Exemple #6
0
 def _rm_file(self, file_path):
     utils.silence(subprocess.call, ('git', 'rm', file_path))
Exemple #7
0
 def _stage_file(self, file_path):
     utils.silence(subprocess.call, ('E:/Program Files/Git/bin/git.exe', 'add', file_path))
Exemple #8
0
 def _unstage_file(self, file_path):
     """ Removes a file from the pending commit """
     utils.silence(subprocess.call, ('git', 'rm', '--cached', file_path))