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.
01-tree-delete-delete.t in vendors/t/fcm-conflicts – NEMO

source: vendors/t/fcm-conflicts/01-tree-delete-delete.t @ 10669

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

Import latest FCM release from Github into the repository for testing

File size: 4.0 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# Basic tests for "fcm conflicts" (tree conflict mode).
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24check_svn_version
25tests 12
26#-------------------------------------------------------------------------------
27setup
28init_repos
29init_branch ctrl $REPOS_URL
30init_branch_wc del_del $REPOS_URL
31cd $TEST_DIR/wc
32#-------------------------------------------------------------------------------
33# Tests fcm conflicts: delete, delete, discard local
34TEST_KEY=$TEST_KEY_BASE-discard
35svn switch -q $ROOT_URL/branches/dev/Share/ctrl
36svn delete -q pro/hello.pro
37svn commit -q -m "Deleted conflict file (local)"
38svn update -q
39svn switch -q $ROOT_URL/branches/dev/Share/del_del
40svn delete -q pro/hello.pro
41svn commit -q -m "Deleted conflict file (merge)"
42svn update -q
43svn switch -q $ROOT_URL/branches/dev/Share/ctrl
44fcm merge --non-interactive $ROOT_URL/branches/dev/Share/del_del >/dev/null
45run_pass "$TEST_KEY" fcm conflicts <<__IN__
46n
47__IN__
48file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
49[info] pro/hello.pro: in tree conflict.
50Locally: deleted.
51Externally: deleted.
52Answer (y) to accept the local delete.
53Answer (n) to accept the external delete.
54Keep the local version?
55Enter "y" or "n" (or just press <return> for "n") Resolved conflicted state of 'pro/hello.pro'
56__OUT__
57file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
58#-------------------------------------------------------------------------------
59# Tests fcm conflicts: delete, delete, discard local (status)
60TEST_KEY=$TEST_KEY_BASE-discard-status
61run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
62file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
63 M      .
64__OUT__
65file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
66#-------------------------------------------------------------------------------
67cd $TEST_DIR
68rm -rf $TEST_DIR/wc
69mkdir $TEST_DIR/wc
70svn checkout -q $ROOT_URL/branches/dev/Share/ctrl $TEST_DIR/wc
71cd $TEST_DIR/wc
72#-------------------------------------------------------------------------------
73# Tests fcm conflicts: delete, delete, keep local
74TEST_KEY=$TEST_KEY_BASE-keep
75fcm merge --non-interactive $ROOT_URL/branches/dev/Share/del_del >/dev/null
76run_pass "$TEST_KEY" fcm conflicts <<__IN__
77y
78__IN__
79file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
80[info] pro/hello.pro: in tree conflict.
81Locally: deleted.
82Externally: deleted.
83Answer (y) to accept the local delete.
84Answer (n) to accept the external delete.
85Keep the local version?
86Enter "y" or "n" (or just press <return> for "n") Resolved conflicted state of 'pro/hello.pro'
87__OUT__
88file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
89#-------------------------------------------------------------------------------
90# Tests fcm conflicts: delete, delete, keep local (status)
91TEST_KEY=$TEST_KEY_BASE-keep-status
92run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
93file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
94 M      .
95__OUT__
96file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
97teardown
98#-------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.