[pacman-dev] [PATCH] makepkg: correctly handle hg sources with updates on a non-default branch
The "tip" ref actually signifies the most recently updated branch. hg does not support a default branch named anything other than "default", except by creating a "@" bookmark. The correct way to explicitly update to the default clone ref, is therefore to use one of these, rather than "tip". Fixes FS#62092 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- scripts/libmakepkg/source/hg.sh.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.21.0
On 1/4/19 2:15 am, Eli Schwartz wrote:
The "tip" ref actually signifies the most recently updated branch. hg does not support a default branch named anything other than "default", except by creating a "@" bookmark. The correct way to explicitly update to the default clone ref, is therefore to use one of these, rather than "tip".
Fixes FS#62092
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- scripts/libmakepkg/source/hg.sh.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Seems to fix the reported bug. I really don't know a log about hg, so lets go with this... A
participants (2)
-
Allan McRae
-
Eli Schwartz