From d0702f8214f261d72c66ac7e400d9af984cd9391 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 22 Mar 2012 11:56:41 -0400 Subject: [PATCH] CTest.UpdateHG: Fix repo URL for leading slash Use "file:///..." instead of "file:////..." when the file system path starts in a slash. Commit 0916cc88 (CTest.UpdateHG: Fix repo URL for local filesystem, 2012-03-02) added a third slash after "file://" unconditionally. This worked for many file systems but not on Cygwin where "file:////cygdrive/..." looks like "file://" followed by a network file path "//cygdrive/...". Add the slash only if the file system path does not already start with one. --- Tests/CTestUpdateHG.cmake.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in index 5a9daae09..640d2c6f3 100644 --- a/Tests/CTestUpdateHG.cmake.in +++ b/Tests/CTestUpdateHG.cmake.in @@ -28,7 +28,10 @@ run_child( WORKING_DIRECTORY ${TOP}/repo.hg COMMAND ${HG} init ) -set(REPO file:///${TOP}/repo.hg) +if(NOT "${TOP}" MATCHES "^/") + set(slash /) +endif() +set(REPO file://${slash}${TOP}/repo.hg) #----------------------------------------------------------------------------- # Import initial content into the repository.