From 88c6043753abf9686a2f6a18a216bc75b9e15586 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 31 Aug 2020 22:04:48 +0000 Subject: pkg_fetch(): go to repository root before checking for Mercurial also check remotes FossilOrigin-Name: 482f5e133fec61f9b02a190e896acbe198e61fc1605d5ee149f32a2b5dc643bd --- src/cpt-lib | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/cpt-lib b/src/cpt-lib index e9e3014..8ef82c5 100644 --- a/src/cpt-lib +++ b/src/cpt-lib @@ -1497,7 +1497,8 @@ pkg_fetch() { for repo; do # Go to the root of the repository (if it exists). cd "$repo" - cd "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null ||: + cd "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || + cd "$(hg root 2>/dev/null)" 2>/dev/null ||: if [ -d .git ]; then @@ -1549,10 +1550,17 @@ pkg_fetch() { ) fi } - elif hg root >/dev/null 2>&1; then - cd "$(hg root)" + elif [ -d .hg ]; then + + [ "$(hg showconfig paths 2>/dev/null)" ] || { + log "$repo" " " + printf '%s\n' "No remote, skipping." + continue + } + contains "$repos $PWD" || { repos="$repos $PWD" + if [ -w "$PWD" ] && [ "$uid" != 0 ]; then hg pull hg update -- cgit v1.2.3