summaryrefslogtreecommitdiff
path: root/scripts/libmakepkg/source/hg.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/libmakepkg/source/hg.sh.in')
-rw-r--r--scripts/libmakepkg/source/hg.sh.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/libmakepkg/source/hg.sh.in b/scripts/libmakepkg/source/hg.sh.in
index 4984883e..2fe32bab 100644
--- a/scripts/libmakepkg/source/hg.sh.in
+++ b/scripts/libmakepkg/source/hg.sh.in
@@ -79,7 +79,11 @@ extract_hg() {
msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "hg"
pushd "$srcdir" &>/dev/null
- local ref=tip
+ local ref=default
+ # Is the repository configured to checkout some ref other than 'default'?
+ if hg identify -r @ "$dir" >/dev/null 2>&1; then
+ ref=@
+ fi
if [[ -n $fragment ]]; then
case ${fragment%%=*} in
branch|revision|tag)