Skip to content
Permalink
Browse files

8238918: idea.sh should work with both mercurial and git repos

Reviewed-by: erikj, mcimadamore, ehelin, lancea
  • Loading branch information
Roger Riggs
Roger Riggs committed Feb 12, 2020
1 parent 411766b commit a239c475cf9f22816650fb36d591fbdff1195190
Showing with 15 additions and 2 deletions.
  1. +14 −1 bin/idea.sh
  2. +1 −1 make/idea/template/vcs.xml
@@ -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"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="###ROOT_DIR###" vcs="hg4idea" />
<mapping directory="###ROOT_DIR###" vcs="###VCS_TYPE###" />
</component>
</project>

0 comments on commit a239c47

Please sign in to comment.