]> granicus.if.org Git - llvm/commit
[CMake] Update GetSVN.cmake to handle repo
authorMinSeong Kim <min.s.kim@samsung.com>
Sat, 9 Sep 2017 14:17:52 +0000 (14:17 +0000)
committerMinSeong Kim <min.s.kim@samsung.com>
Sat, 9 Sep 2017 14:17:52 +0000 (14:17 +0000)
commit491dc19ec454a3b0aa25e834e6c4098dd46aaa3a
treec769c4497894b7483c68e9c9b260622d5006bd35
parent2d82e741fe75344ed257e6139697ddedfc2d6d9f
[CMake] Update GetSVN.cmake to handle repo

Summary:
When repo is used with git, 'clang --version' option does not display
the correct revision information (i.e. git hash on TOP) as the following:

clang version 6.0.0 --->
clang version 6.0.0 (clang version) (llvm version)

This is because repo also creates .git/svn folder as git-svn does and
this makes repo with git uses "git svn info" command, which is only for
git-svn, to retrieve its revision information, making null for the info.
To correctly distinguish between git-svn and repo with git, the folder
hierarchy to specify for git-svn should be .git/svn/refs as the "git svn
info" command depends on the revision data in .git/svn/refs. This patch
in turn makes repo with git passes through to the third macro,
get_source_info_git, in  get_source_info function, resulting in correctly
retrieving the revision information for repo with git using "git log ..."
command.

This patch is tested with git, svn, git-svn, and repo with git.

Reviewers: llvm-commits, probinson, rnk

Reviewed By: rnk

Subscribers: rnk, mehdi_amini, beanz, mgorny

Differential Revision: https://reviews.llvm.org/D35532

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312864 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/GetSVN.cmake