예제 #1
0
    def is_a_svn_repo(self):
        exit_code, stdout, stderr = execute_command_and_capture_output(
            "svn", "status")
        if "not a working copy" in stderr or exit_code != 0:
            return False

        return True
예제 #2
0
파일: vcs.py 프로젝트: 0xD3ADB33F/pybuilder
 def get_svn_revision_count(self):
     exit_code, stdout, stderr = execute_command_and_capture_output(
         "svnversion")
     if exit_code != 0 or "Unversioned directory" in stdout or "Uncommitted" in stdout:
         raise PyBuilderException("Cannot determine svn revision: svnversion failed or unversioned directory:\n{0}".
                                  format(stderr))
     return stdout.strip().replace("M", "").replace("S", "").replace("P", "").split(":")[0]
예제 #3
0
 def get_svn_revision_count(self):
     exit_code, stdout, stderr = execute_command_and_capture_output(
         "svnversion")
     if exit_code != 0 or "Unversioned directory" in stdout or "Uncommitted" in stdout:
         raise PyBuilderException("Cannot determine svn revision: svnversion failed or unversioned directory:\n{0}".
                                  format(stderr))
     return stdout.strip().replace("M", "").replace("S", "").replace("P", "").split(":")[0]
예제 #4
0
파일: vcs.py 프로젝트: 0xD3ADB33F/pybuilder
 def get_git_revision_count(self):
     # NOTE: git rev-list HEAD --count does not work on RHEL6, hence we count ourselves.
     exit_code, stdout, stderr = execute_command_and_capture_output(
         "git", "rev-list", "HEAD")
     if exit_code != 0:
         raise PyBuilderException("Cannot determine git revision: git rev-list HEAD failed:\n{0}".
                                  format(stderr))
     return str(len(stdout.splitlines()))
예제 #5
0
 def get_git_revision_count(self):
     # NOTE: git rev-list HEAD --count does not work on RHEL6, hence we count ourselves.
     exit_code, stdout, stderr = execute_command_and_capture_output(
         "git", "rev-list", "HEAD")
     if exit_code != 0:
         raise PyBuilderException("Cannot determine git revision: git rev-list HEAD failed:\n{0}".
                                  format(stderr))
     return str(len(stdout.splitlines()))
예제 #6
0
파일: vcs.py 프로젝트: 0xD3ADB33F/pybuilder
 def get_git_hash(self, abbreviate=7):
     if self.is_a_git_repo():
         exit_code, stdout, stderr = execute_command_and_capture_output(
             "git", "rev-parse", "--short={0}".format(abbreviate), "HEAD")
         if exit_code != 0:
             raise PyBuilderException("Cannot determine git hash: git rev-parse HEAD failed:\n{0}".
                                      format(stderr))
         else:
             return stdout.strip()
     else:
         raise PyBuilderException("Cannot determine git hash: project is not a git repo.")
예제 #7
0
 def get_git_description(self):
     if self.is_a_git_repo():
         exit_code, stdout, stderr = execute_command_and_capture_output(
             "git", "describe", "--always", "--tags", "--dirty")
         if exit_code != 0:
             raise PyBuilderException("Cannot determine git description: git describe failed:\n{0}".
                                      format(stderr))
         else:
             return stdout.strip()
     else:
         raise PyBuilderException("Cannot determine git description: project is not a git repo.")
예제 #8
0
 def get_git_hash(self, abbreviate=7):
     if self.is_a_git_repo():
         exit_code, stdout, stderr = execute_command_and_capture_output(
             "git", "rev-parse", "--short={0}".format(abbreviate), "HEAD")
         if exit_code != 0:
             raise PyBuilderException("Cannot determine git hash: git rev-parse HEAD failed:\n{0}".
                                      format(stderr))
         else:
             return stdout.strip()
     else:
         raise PyBuilderException("Cannot determine git hash: project is not a git repo.")
예제 #9
0
파일: vcs.py 프로젝트: 0xD3ADB33F/pybuilder
    def is_a_svn_repo(self):
        exit_code, stdout, stderr = execute_command_and_capture_output("svn", "status")
        if "not a working copy" in stderr or exit_code != 0:
            return False

        return True
예제 #10
0
파일: vcs.py 프로젝트: 0xD3ADB33F/pybuilder
 def is_a_git_repo(self):
     exit_code, _, __ = execute_command_and_capture_output("git", "status")
     if exit_code == 0:
         return True
     return False
예제 #11
0
 def is_a_git_repo(self):
     exit_code, _, __ = execute_command_and_capture_output("git", "status")
     if exit_code == 0:
         return True
     return False