예제 #1
0
 def init(self):
     """ Creates a new git repository. """
     self._chdir()
     utils.silence(
         subprocess.call,
         ('E:/Program Files/Git/bin/git.exe', 'init')
     )
예제 #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
예제 #3
0
 def push(self):
     utils.silence(
         subprocess.call,
         (
             'E:/Program Files/Git/bin/git.exe',
             'push'
         ),
     )
예제 #4
0
 def checkout(self,branch):
     utils.silence(
         subprocess.call,
         (
             'E:/Program Files/Git/bin/git.exe',
             'checkout',
             branch,
         )
     )
예제 #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)
         ),
     )
예제 #6
0
 def _rm_file(self, file_path):
     utils.silence(subprocess.call, ('git', 'rm', file_path))
예제 #7
0
 def _stage_file(self, file_path):
     utils.silence(subprocess.call, ('E:/Program Files/Git/bin/git.exe', 'add', file_path))
예제 #8
0
 def _unstage_file(self, file_path):
     """ Removes a file from the pending commit """
     utils.silence(subprocess.call, ('git', 'rm', '--cached', file_path))