__svn_version.pyx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import future.utils as fu
  2. cdef extern from "library/cpp/svnversion/svnversion.h":
  3. cdef const char* GetVCS() except +;
  4. cdef const char* GetProgramSvnVersion() except +;
  5. cdef int GetProgramSvnRevision() except +;
  6. cdef int GetArcadiaLastChangeNum() except +;
  7. cdef const char* GetProgramCommitId() except +;
  8. cdef const char* GetProgramHash() except +;
  9. cdef const char* GetBranch() except +;
  10. cdef const char* GetTag() except +;
  11. cdef int GetArcadiaPatchNumber() except +;
  12. def svn_version():
  13. return fu.bytes_to_native_str(GetProgramSvnVersion())
  14. def svn_revision():
  15. return GetProgramSvnRevision()
  16. def svn_last_revision():
  17. return GetArcadiaLastChangeNum()
  18. def commit_id():
  19. return fu.bytes_to_native_str(GetProgramCommitId())
  20. def hash():
  21. return fu.bytes_to_native_str(GetProgramHash())
  22. def svn_branch():
  23. return fu.bytes_to_native_str(GetBranch())
  24. def svn_tag():
  25. return fu.bytes_to_native_str(GetTag())
  26. def patch_number():
  27. return GetArcadiaPatchNumber()
  28. def vcs():
  29. return fu.bytes_to_native_str(GetVCS())