# HG changeset patch # User Houzefa Abbasbhay <houzefa.abba@xcg-consulting.fr> # Date 1593432886 -7200 # Mon Jun 29 14:14:46 2020 +0200 # Node ID d05166dbac2fb919cd262881619e91df9349e198 # Parent 00330764ffcf8b607e734ad7b54287bbf9e0760c update_duplicate_sources: Rely on clone URL Rely on the metaproject clone URL instead of its directory name. Works fine with the bitbucket.org âž” orus.io move. diff --git a/NEWS.rst b/NEWS.rst --- a/NEWS.rst +++ b/NEWS.rst @@ -9,6 +9,8 @@ Add ODOO_ADDONS_PATH env var to start. Add import_sql script. Add option to bind odoo sources in the image +- ``update_duplicate_sources`` now relies on the metaproject clone URL instead + of its directory name. Works fine with the bitbucket.org âž” orus.io move. 3.0 --- diff --git a/update_duplicate_sources b/update_duplicate_sources --- a/update_duplicate_sources +++ b/update_duplicate_sources @@ -1,17 +1,20 @@ #!/bin/zsh # vim: set shiftwidth=4 softtabstop=4 tabstop=4 expandtab: # -# This script update another repository that is a copy of the sources +# This script updates another repository that is a copy of the sources. +# Made to be shared with external people. +# The resulting repository won't have the full history log but only tags pushed when running this +# script. Also all sources will be merged within one repository (as in no confman / .hgconf). # -# Assertion: -# - the source project already exist on bitbucket and its name is the same as the metaproject+_sources +# Assertions: +# - this is run from the metaproject via "odoo_scripts/update_duplicate_sources" +# - the metaproject is on a tag (run "hg id" to make sure) +# - the source project already exists on orus.io and its path is the same as the metaproject with +# the "_sources" suffix # - the metaproject is the same type as the sources one here=$(dirname $0) project_home=$(cd $here && cd .. && echo $PWD) -project_name=$(basename $project_home) - -source_name=${project_name}_sources $here/list_modules @@ -32,7 +35,10 @@ if [ -e ".hg" ]; then branch="$(hg id -b)" tags=($(hg id -t)) - hg clone ssh://hg@bitbucket.org/xcg/${source_name} || exit 1 + project_url=$(hg paths default) + source_url=${project_url}_sources + source_name=$(basename $source_url) + hg clone $source_url || exit 1 pushd $source_name hg update $branch branch_exist=$?