FIND_PROGRAM(HG "hg")
IF(HG)
- EXECUTE_PROCESS(COMMAND "${HG} id > /dev/null" OUTPUT_VARIABLE HG_ID)
+ EXECUTE_PROCESS(COMMAND "${HG}" id OUTPUT_VARIABLE HG_ID ERROR_QUIET)
IF(HG_ID)
STRING(REGEX MATCH ^[0-9a-z]+ ID "${HG_ID}")
ELSE(HG_ID)
IF(HG_ID)
STRING(REGEX MATCH "node: [0-9a-z]+" _tmp "${HG_ID}")
STRING(SUBSTRING "${_tmp}" 6 12 ID)
- ENDIF(HG_ID)
- ENDIF(HG_ARCH)
+ ENDIF(HG_ID)
+ ELSE(HG_ARCH)
+ # Maybe this is git copy
+ FIND_PROGRAM(GIT "git")
+ IF(GIT)
+ EXECUTE_PROCESS(COMMAND "${GIT}" branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET)
+ IF(GIT_ID)
+ STRING(REGEX REPLACE "^. [0-9a-z]+ ([0-9a-f]+) .*" \\1 ID "${GIT_ID}")
+ ENDIF(GIT_ID)
+ ENDIF(GIT)
+ ENDIF(HG_ARCH)
ENDIF(HG_ID)
ELSE(HG)
# Now check .hg_archival.txt
STRING(REGEX MATCH "node: [0-9a-z]+" _tmp "${HG_ID}")
STRING(SUBSTRING "${_tmp}" 6 12 ID)
ENDIF(HG_ID)
+ ELSE(HG_ARCH)
+ # Maybe this is git copy
+ FIND_PROGRAM(GIT "git")
+ IF(GIT)
+ EXECUTE_PROCESS(COMMAND "${GIT}" branch -v OUTPUT_VARIABLE GIT_ID ERROR_QUIET)
+ IF(GIT_ID)
+ STRING(REGEX REPLACE "^. [0-9a-z]+ ([0-9a-f]+) .*" \\1 ID "${GIT_ID}")
+ ENDIF(GIT_ID)
+ ENDIF(GIT)
ENDIF(HG_ARCH)
ENDIF(HG)