VirtualBox

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

最後變更 在這個檔案從84251是 83680,由 vboxsync 提交於 5 年 前

tools/bin/backport-*: Adding a --update-first option to update the branch before merging.

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 3.1 KB
 
1# !kmk_ash
2# $Id: backport-merge.sh 83680 2020-04-11 18:44:19Z 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.alldomusa.eu.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# Check that the branch is clean if first revision.
38#
39if test -n "${MY_FIRST_REV}"; then
40 MY_STATUS=`"${MY_SVN}" status -q "${MY_BRANCH_DIR}"`
41 if test -n "${MY_STATUS}"; then
42 echo "error: Branch already has changes pending..."
43 "${MY_SVN}" status -q "${MY_BRANCH_DIR}"
44 exit 1;
45 fi
46 test -z "${MY_DEBUG}" || echo "debug: Found no pending changes on branch."
47fi
48
49#
50# Update branch if requested.
51#
52if test -n "${MY_UPDATE_FIRST}"; then
53 if ! "${MY_SVN}" update "${MY_BRANCH_DIR}" --ignore-externals; then
54 echo "error: branch updating failed..."
55 exit 1;
56 fi
57 test -z "${MY_DEBUG}" || echo "debug: Updated the branch."
58fi
59
60#
61# Do the merging.
62#
63MY_DONE_REVS=
64MY_FAILED_REV=
65MY_TODO_REVS=
66test -n "${MY_DEBUG}" && echo "MY_REVISIONS=${MY_REVISIONS}"
67for MY_REV in ${MY_REVISIONS};
68do
69 if test -z "${MY_FAILED_REV}"; then
70 echo "***"
71 echo "*** Merging r${MY_REV} ..."
72 echo "***"
73 if "${MY_SVN}" merge ${MY_MERGE_ARGS} "${MY_TRUNK_DIR}" "${MY_BRANCH_DIR}" -c ${MY_REV}; then
74 # Check for conflict.
75 MY_CONFLICTS=`"${MY_SVN}" status "${MY_BRANCH_DIR}" | "${MY_SED}" -n -e '/^C/p'`
76 if test -z "${MY_CONFLICTS}"; then
77 if test -z "${MY_DONE_REVS}"; then
78 MY_DONE_REVS=${MY_REV}
79 else
80 MY_DONE_REVS="${MY_DONE_REVS} ${MY_REV}"
81 fi
82 else
83 echo '!!!'" Have conflicts after merging ${MY_REV}."
84 MY_FAILED_REV=${MY_REV}
85 fi
86 else
87 echo '!!!'" Failed merging r${MY_REV}."
88 MY_FAILED_REV=${MY_REV}
89 fi
90 else
91 if test -z "${MY_TODO_REVS}"; then
92 MY_TODO_REVS=${MY_REV}
93 else
94 MY_TODO_REVS="${MY_TODO_REVS} ${MY_REV}"
95 fi
96 fi
97done
98
99if test -z "${MY_FAILED_REV}"; then
100 echo "* Successfully merged all revision (${MY_DONE_REVS})."
101 exit 0;
102fi
103if test -n "${MY_DONE_REVS}"; then
104 echo "* Successfully merged: ${MY_DONE_REVS}"
105fi
106if test -n "${MY_TODO_REVS}"; then
107 echo "* Revisions left todo: ${MY_TODO_REVS}"
108fi
109exit 1;
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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