__svn_version.pyx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. cdef int GetProgramBuildTimestamp() except +;
  13. def svn_version():
  14. return fu.bytes_to_native_str(GetProgramSvnVersion())
  15. def svn_revision():
  16. return GetProgramSvnRevision()
  17. def svn_last_revision():
  18. return GetArcadiaLastChangeNum()
  19. def commit_id():
  20. return fu.bytes_to_native_str(GetProgramCommitId())
  21. def hash():
  22. return fu.bytes_to_native_str(GetProgramHash())
  23. def svn_branch():
  24. return fu.bytes_to_native_str(GetBranch())
  25. def svn_tag():
  26. return fu.bytes_to_native_str(GetTag())
  27. def svn_timestamp():
  28. return GetProgramBuildTimestamp()
  29. def patch_number():
  30. return GetArcadiaPatchNumber()
  31. def vcs():
  32. return fu.bytes_to_native_str(GetVCS())