Move restore_{sc,upstream} to merge_helpers.sh

Easier to use manually

Change-Id: Ieb87301e2b0b5d7e1299d3d0c8d49992d4cdde63
This commit is contained in:
SpiritCroc 2020-12-22 09:15:42 +01:00
parent 15f3974b89
commit c30a9b8a57
3 changed files with 27 additions and 26 deletions

View File

@ -58,3 +58,30 @@ downstream_upstream_diff() {
local downstream_tag=`downstream_latest_tag`
git diff "$previous_tag".."$downstream_latest_tag" "$@"
}
# Opposite to restore_sc
restore_upstream() {
local f="$(basename "$1")"
local path="$(dirname "$1")"
local sc_f="tmp_sc_$f"
local upstream_f="upstream_$f"
mv "$path/$f" "$path/$sc_f"
if [ -e "$path/$upstream_f" ]; then
mv "$path/$upstream_f" "$path/$f"
fi
}
# Oposite to restore_upstream
restore_sc() {
local f="$(basename "$1")"
local path="$(dirname "$1")"
local sc_f="tmp_sc_$f"
local upstream_f="upstream_$f"
if [ -e "$path/$f" ]; then
mv "$path/$f" "$path/$upstream_f"
fi
if [ -e "$path/$sc_f" ]; then
mv "$path/$sc_f" "$path/$f"
fi
}

View File

@ -8,20 +8,6 @@ source "$mydir/merge_helpers.sh"
# Require clean git state
require_clean_git
# Oposite of restore_upstream in post_merge.sh
restore_sc() {
local f="$(basename "$1")"
local path="$(dirname "$1")"
local sc_f="tmp_sc_$f"
local upstream_f="upstream_$f"
if [ -e "$path/$f" ]; then
mv "$path/$f" "$path/$upstream_f"
fi
if [ -e "$path/$sc_f" ]; then
mv "$path/$sc_f" "$path/$f"
fi
}
# Color corrections | TODO more?
sed -i 's|@color/riotx_accent|?colorAccent|g' vector/src/main/res/layout/*
uncommitted=`git status --porcelain`

View File

@ -8,18 +8,6 @@ source "$mydir/merge_helpers.sh"
# Require clean git state
require_clean_git
# Oposite of restore_sc in post_merge.sh
restore_upstream() {
local f="$(basename "$1")"
local path="$(dirname "$1")"
local sc_f="tmp_sc_$f"
local upstream_f="upstream_$f"
mv "$path/$f" "$path/$sc_f"
if [ -e "$path/$upstream_f" ]; then
mv "$path/$upstream_f" "$path/$f"
fi
}
# Revert Schildi's upstream string changes
git checkout `upstream_previous_tag` -- `find "$mydir/vector/src/main/res" -name strings.xml`
git commit -m "Automatic revert to unchanged upstream strings, pt.1"