Commit d0dd0de6 authored by Zen Fu's avatar Zen Fu
Browse files

Merge remote-tracking branch 'hefee/hefee/remote_push_merge_canonocal_changes'

parents 9d42b84d 4cf232c3
......@@ -26,26 +26,36 @@ git_fetch() {
)
}
git_force_push() {
checkout="$1"
remote="$2"
branch="$3"
log "Force-pushing ${branch} branch of '${checkout}' to the '${remote}' remote..."
(
cd "${checkout}"
git push --quiet ${remote} +${branch} >> "$UPDATE_LOGFILE" 2>&1
log "done."
)
}
docron() {
log "Merging changes from main repo into the integration repo..."
git_fetch "${INTEGRATION_GIT_CHECKOUT}" origin
/var/lib/weblate/scripts/merge_canonical_changes.py \
--push \
"${INTEGRATION_GIT_CHECKOUT}" origin/master
log "done."
git_force_push "${INTEGRATION_GIT_CHECKOUT}" weblate-gatekeeper master
log "Fetching and merging changes made by Weblate into the integration repo..."
git_fetch "${INTEGRATION_GIT_CHECKOUT}" weblate
/var/lib/weblate/scripts/merge_weblate_changes.py \
"${INTEGRATION_GIT_CHECKOUT}" weblate/master
log "done."
(
log "Force-pushing master branch of '${INTEGRATION_GIT_CHECKOUT}' to the 'weblate-gatekeeper' remote..."
cd "${INTEGRATION_GIT_CHECKOUT}"
git push --quiet weblate-gatekeeper +master >> "$UPDATE_LOGFILE" 2>&1
log "done."
)
git_force_push "${INTEGRATION_GIT_CHECKOUT}" weblate-gatekeeper master
git_fetch "${WEBLATE_GIT_CHECKOUT}" origin
......
......@@ -386,7 +386,7 @@ def updateNonMainGitLangs(source, target, potFile, tree, repopath, index):
return "\n".join(msgs)
def main(repopath, local, localCommit, remote, pushChanges=False):
def main(repopath, local, localCommit, remote):
r = git.Repo(str(repopath))
msg = "merge with main git using {}.\n\n".format(prog)
......@@ -579,11 +579,6 @@ def main(repopath, local, localCommit, remote, pushChanges=False):
# Set the working tree to the new status of "local" and empty the index
local.checkout(force=True)
if remoteBranch and pushChanges:
logger.info('pushing changes...')
_r = r.remotes[remoteBranch.remote_name]
_r.push()
def commandline():
import argparse
......@@ -607,10 +602,6 @@ def commandline():
"-d", "--debug",
action='store_true',
help="keep intermediate step files in {}/.".format(debugPath))
parser.add_argument(
"--push",
action='store_true',
help="Push created merge commits to remote.")
parser.add_argument(
"--local",
default="master",
......@@ -646,7 +637,7 @@ def commandline():
def temporaryDirectory(path):
return tempfile.TemporaryDirectory()
try:
main(args.repopath, args.local, args.localCommit, args.remote, args.push)
main(args.repopath, args.local, args.localCommit, args.remote)
except:
logger.exception("-- Something unexpected happened. Giving up. --")
raise
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment