VirtualBox

source: vbox/trunk/tools/bin/backport-merge.sh@ 83677

Last change on this file since 83677 was 83668, checked in by vboxsync, 5 years ago

Forward ported r137145 from 5.2: backport-merge.sh: fixed error handling.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1# !kmk_ash
2# $Id: backport-merge.sh 83668 2020-04-10 13:09:21Z vboxsync $
3## @file
4# Script for merging a backport from trunk.
5#
6
7#
8# Copyright (C) 2020 Oracle Corporation
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18
19#
20# Determin script dir so we can source the common bits.
21#
22MY_SED=kmk_sed
23MY_SCRIPT_DIR=`echo "$0" | "${MY_SED}" -e 's|\\\|/|g' -e 's|^\(.*\)/[^/][^/]*$|\1|'` # \ -> / is for windows.
24if test "${MY_SCRIPT_DIR}" = "$0"; then
25 MY_SCRIPT_DIR=`pwd -L`
26else
27 MY_SCRIPT_DIR=`cd "${MY_SCRIPT_DIR}"; pwd -L` # pwd is built into kmk_ash.
28fi
29
30#
31# This does a lot.
32#
33MY_SCRIPT_NAME="backport-merge.sh"
34. "${MY_SCRIPT_DIR}/backport-common.sh"
35
36#
37# Do the merging.
38#
39MY_DONE_REVS=
40MY_FAILED_REV=
41MY_TODO_REVS=
42test -n "${MY_DEBUG}" && echo "MY_REVISIONS=${MY_REVISIONS}"
43for MY_REV in ${MY_REVISIONS};
44do
45 if test -z "${MY_FAILED_REV}"; then
46 echo "***"
47 echo "*** Merging r${MY_REV} ..."
48 echo "***"
49 if "${MY_SVN}" merge ${MY_MERGE_ARGS} "${MY_TRUNK_DIR}" "${MY_BRANCH_DIR}" -c ${MY_REV}; then
50 # Check for conflict.
51 MY_CONFLICTS=`"${MY_SVN}" status "${MY_BRANCH_DIR}" | "${MY_SED}" -n -e '/^C/p'`
52 if test -z "${MY_CONFLICTS}"; then
53 MY_DONE_REVS="${MY_DONE_REVS} ${MY_REV}"
54 else
55 echo '!!!'" Have conflicts after merging ${MY_REV}."
56 MY_FAILED_REV=${MY_REV}
57 fi
58 else
59 echo '!!!'" Failed merging r${MY_REV}."
60 MY_FAILED_REV=${MY_REV}
61 fi
62 else
63 MY_TODO_REVS="${MY_TODO_REVS} ${MY_REV}"
64 fi
65done
66
67if test -z "${MY_FAILED_REV}"; then
68 echo "* Successfully merged all revision (${MY_DONE_REVS})."
69 exit 0;
70fi
71if test -n "${MY_DONE_REVS}"; then
72 echo "* Successfully merged: ${MY_DONE_REVS}"
73fi
74if test -n "${MY_TODO_REVS}"; then
75 echo "* Revisions left todo: ${MY_TODO_REVS}"
76fi
77exit 1;
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette