New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
11-tree-edit-replace.t in vendors/FCM-2017.10.0/t/fcm-conflicts – NEMO

source: vendors/FCM-2017.10.0/t/fcm-conflicts/11-tree-edit-replace.t @ 12377

Last change on this file since 12377 was 10672, checked in by nicolasmartin, 5 years ago

Reimport latest FCM release

File size: 3.4 KB
Line 
1#!/bin/bash
2# ------------------------------------------------------------------------------
3# (C) British Crown Copyright 2006-17 Met Office.
4#
5# This file is part of FCM, tools for managing and building source code.
6#
7# FCM is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# FCM is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with FCM. If not, see <http://www.gnu.org/licenses/>.
19# ------------------------------------------------------------------------------
20# Tree conflict: local file edit, incoming file replace upon merge
21#-------------------------------------------------------------------------------
22. "$(dirname "$0")/test_header"
23#-------------------------------------------------------------------------------
24check_svn_version
25tests 6
26#-------------------------------------------------------------------------------
27setup
28init_repos
29init_branch replace "${REPOS_URL}"
30init_branch_wc edit "${REPOS_URL}"
31cd "${TEST_DIR}/wc"
32svn switch -q "${ROOT_URL}/branches/dev/Share/replace"
33HELLO="$(<'pro/hello.pro')"
34svn delete -q 'pro/hello.pro'
35svn commit -q -m 'Remove local copy of conflict file'
36echo 'Replace contents (1)' >'pro/hello.pro'
37svn add 'pro/hello.pro'
38svn commit -q -m 'Replace local copy of conflict file'
39svn switch -q "${ROOT_URL}/branches/dev/Share/edit"
40echo 'Merge contents (1)' >>'pro/hello.pro'
41svn commit -q -m 'Modified and renamed merge copy of conflict file'
42svn update -q
43#-------------------------------------------------------------------------------
44TEST_KEY="${TEST_KEY_BASE}-leip-y"
45fcm merge --non-interactive "${ROOT_URL}/branches/dev/Share/replace" >'/dev/null'
46run_pass "${TEST_KEY}" fcm conflicts <<<'y'
47sed -i "/^Resolved conflicted state of 'pro\/hello.pro'$/d" \
48    ${TEST_DIR}/"${TEST_KEY}.out"
49file_cmp "${TEST_KEY}.out" "${TEST_KEY}.out" <<'__OUT__'
50[info] pro/hello.pro: in tree conflict.
51Locally: edited.
52Externally: replaced.
53Answer (y) to keep the file.
54Answer (n) to accept the external replace.
55Keep the local version?
56Enter "y" or "n" (or just press <return> for "n") Resolved conflicted state of 'pro/hello.pro'
57__OUT__
58file_cmp "${TEST_KEY}.err" "${TEST_KEY}.err" <'/dev/null'
59#-------------------------------------------------------------------------------
60TEST_KEY="${TEST_KEY_BASE}-leip-n"
61svn revert -R -q .
62rm '#commit_message#'
63fcm merge --non-interactive "${ROOT_URL}/branches/dev/Share/replace" >'/dev/null'
64run_pass "${TEST_KEY}" fcm conflicts <<<'n'
65sed -i "/^Resolved conflicted state of 'pro\/hello.pro'$/d" \
66    ${TEST_DIR}/"${TEST_KEY}.out"
67file_cmp "${TEST_KEY}.out" "${TEST_KEY}.out" <<'__OUT__'
68[info] pro/hello.pro: in tree conflict.
69Locally: edited.
70Externally: replaced.
71Answer (y) to keep the file.
72Answer (n) to accept the external replace.
73Keep the local version?
74Enter "y" or "n" (or just press <return> for "n") D         pro/hello.pro
75A         pro/hello.pro
76__OUT__
77file_cmp "${TEST_KEY}.err" "${TEST_KEY}.err" <'/dev/null'
78#-------------------------------------------------------------------------------
79exit
Note: See TracBrowser for help on using the repository browser.