
Previously it was using #!/bin/bash as its interpreter. It is not compatible with FreeBSD because bash is not installed by default. The update-revision script is #!/bin/sh compatible and there are other examples of #!/bin/sh scripts in the codebase so the change is consistent with them. original commit: 0ad188cdbd618b369e7fe6d2b9446251fe92e891
23 lines
636 B
Bash
Executable File
23 lines
636 B
Bash
Executable File
#!/bin/sh
|
|
if [ -d ../../.git ]; then
|
|
git describe --always --exclude='*' --abbrev=40 --dirty
|
|
echo 'git'
|
|
elif [ -d ../../.hg ]; then
|
|
DIRTY="$(hg status -n --color never --pager never | head -1)"
|
|
hg log --limit 1 --template '{node}' --pager never
|
|
if [ -n "${DIRTY}" ]; then
|
|
echo '-dirty'
|
|
else
|
|
echo ''
|
|
fi
|
|
echo 'hg'
|
|
elif [ -f ../../.hg_archival.txt ]; then
|
|
# hg archive and hgweb embed this file by default (see .hgrc archivemeta)
|
|
sed -n 's/^node: \(.*\)/\1/p' < ../../.hg_archival.txt
|
|
echo 'hg'
|
|
else
|
|
# use export-subst git attribute to populate revision for git archive
|
|
echo '$Format:%H$'
|
|
echo 'git'
|
|
fi
|