Admin/PIDE/convert
author wenzelm
Mon, 26 Nov 2012 10:37:05 +0100
changeset 50210 747db833fbf7
parent 46245 01496117a5cc
child 53498 05313b45a5ae
permissions -rwxr-xr-x
no special treatment of control_reset, in accordance to other control styles;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46245
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     1
#!/bin/bash
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     2
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     3
THIS="$(cd "$(dirname "$0")"; pwd)"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     4
SUPER="$(cd "$THIS/.."; pwd)"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     5
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     6
ISABELLE_REPOS="$(cd "$THIS/../.."; pwd)"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     7
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     8
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     9
## main
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    10
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    11
FILEMAP="/tmp/filemap$$"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    12
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    13
echo "include COPYRIGHT" > "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    14
(
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    15
  cd "$ISABELLE_REPOS"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    16
  for FILE in $(find src/Pure -name "*.scala")
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    17
  do
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    18
    if grep "Module:.*PIDE" "$FILE" >/dev/null; then
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    19
      if [ "$("${HG:-hg}" status -u -n --color=never "$FILE")" = "" ]; then
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    20
        echo "include $FILE" >> "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    21
        echo "rename $FILE src/$(basename "$FILE")" >> "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    22
      fi
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    23
    fi
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    24
  done
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    25
)
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    26
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    27
cat "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    28
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    29
"${HG:-hg}" convert --filemap "$FILEMAP" "$ISABELLE_REPOS" PIDE-repos
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    30
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    31
rm -f "$FILEMAP"