From a239c475cf9f22816650fb36d591fbdff1195190 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Wed, 12 Feb 2020 09:38:59 -0500 Subject: [PATCH] 8238918: idea.sh should work with both mercurial and git repos Reviewed-by: erikj, mcimadamore, ehelin, lancea --- bin/idea.sh | 15 ++++++++++++++- make/idea/template/vcs.xml | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/idea.sh b/bin/idea.sh index 9ede324c7a5..3099e2f79ee 100644 --- a/bin/idea.sh +++ b/bin/idea.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -113,6 +113,18 @@ if [ "x$SPEC" = "x" ] ; then echo "FATAL: SPEC is empty" >&2; exit 1 fi +if [ -d "$TOPLEVEL_DIR/.hg" ] ; then + VCS_TYPE="hg4idea" +fi + +if [ -d "$TOPLEVEL_DIR/.git" ] ; then + VCS_TYPE="Git" +fi + +if [ "x$VCS_TYPE" = "x" ] ; then + echo "FATAL: VCS_TYPE is empty" >&2; exit 1 +fi + ### Replace template variables NUM_REPLACEMENTS=0 @@ -137,6 +149,7 @@ add_replacement() { } add_replacement "###MODULE_NAMES###" "$MODULE_NAMES" +add_replacement "###VCS_TYPE###" "$VCS_TYPE" SPEC_DIR=`dirname $SPEC` if [ "x$CYGPATH" = "x" ]; then add_replacement "###BUILD_DIR###" "$SPEC_DIR" diff --git a/make/idea/template/vcs.xml b/make/idea/template/vcs.xml index 21997970079..ee4faed424a 100644 --- a/make/idea/template/vcs.xml +++ b/make/idea/template/vcs.xml @@ -1,6 +1,6 @@ - +