source: vendors/FCM-2017.10.0/t/fcm-merge/01-complex.t @ 11150

Last change on this file since 11150 was 10672, checked in by nicolasmartin, 3 years ago

Reimport latest FCM release

File size: 57.1 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# More complex tests for "fcm merge".
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24check_svn_version
25tests 234
26#-------------------------------------------------------------------------------
27setup
28init_repos
29init_merge_branches merge1 merge2 $REPOS_URL
30export SVN_EDITOR="sed -i 1i\foo"
31cd $TEST_DIR/wc
32svn switch -q $ROOT_URL/branches/dev/Share/merge1
33#-------------------------------------------------------------------------------
34# Test the various mergeinfo output before merging.
35test_mergeinfo "$TEST_KEY_BASE-trunk-into-branch-1-pre" \
36    $ROOT_URL/trunk - 9 <<__RESULTS__
37begin-prop
38end-prop
39begin-info
40    youngest common ancestor
41    |         last full merge
42    |         |        tip of branch
43    |         |        |         repository path
44
45    1                  9       
46    |                  |       
47  -------| |------------         trunk
48     \                        
49      \                        
50       --| |------------         branches/dev/Share/merge1
51                       |       
52                       WC     
53end-info
54begin-eligible
55r8
56r9
57end-eligible
58begin-merged
59end-merged
60__RESULTS__
61#-------------------------------------------------------------------------------
62# Tests fcm merge of trunk-into-branch (1)
63TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-1-non-root
64cd module
65run_pass "$TEST_KEY" fcm merge --non-interactive trunk
66file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
67$TEST_DIR/wc: working directory changed to top of working copy.
68Eligible merge(s) from /${PROJECT}trunk@9: 9 8
69--------------------------------------------------------------------------------
70Merge: /${PROJECT}trunk@9
71 c.f.: /${PROJECT}trunk@1
72Merge succeeded.
73--------------------------------------------------------------------------actual
74--- Merging r2 through r9 into '.':
75U    lib/python/info/__init__.py
76--- Recording mergeinfo for merge of r2 through r9 into '.':
77 U   .
78--------------------------------------------------------------------------actual
79__OUT__
80file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
81cd ..
82#-------------------------------------------------------------------------------
83# Tests svn status result of fcm merge (1)
84TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-1-status
85run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
86status_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
87file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
88 M      .
89?       unversioned_file
90M       lib/python/info/__init__.py
91__OUT__
92file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
93#-------------------------------------------------------------------------------
94# Tests svn diff result of fcm merge (1)
95TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-1-diff
96run_pass "$TEST_KEY" svn diff
97diff_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
98diff_svn_version_filter >"$TEST_DIR/$TEST_KEY.sorted.ctrl" <<__OUT__
99
100Index: .
101===================================================================
102--- . (revision 9)
103+++ . (working copy)
104
105Property changes on: .
106___________________________________________________________________
107Added: svn:mergeinfo
108#IF SVN1.9 ## -0,0 +0,1 ##
109   Merged /${PROJECT}trunk:r2-9
110Index: lib/python/info/__init__.py
111===================================================================
112--- lib/python/info/__init__.py  (revision 9)
113+++ lib/python/info/__init__.py  (working copy)
114@@ -0,0 +1,2 @@
115+trunk change
116+another trunk change
117__OUT__
118file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" \
119    "$TEST_DIR/$TEST_KEY.sorted.ctrl" 
120file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
121#-------------------------------------------------------------------------------
122# Tests fcm commit of fcm merge (1)
123TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-1-commit
124run_pass "$TEST_KEY" fcm commit <<__IN__
125y
126__IN__
127commit_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
128file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
129[info] sed -i 1i\foo: starting commit message editor...
130Change summary:
131--------------------------------------------------------------------------------
132[Root   : $REPOS_URL]
133[Project: ${TEST_PROJECT:-}]
134[Branch : branches/dev/Share/merge1]
135[Sub-dir: ]
136 M      .
137M       lib/python/info/__init__.py
138--------------------------------------------------------------------------------
139Commit message is as follows:
140--------------------------------------------------------------------------------
141foo
142Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@9 cf. /${PROJECT}trunk@1
143--------------------------------------------------------------------------------
144*** WARNING: YOU ARE COMMITTING TO A Share BRANCH.
145*** Please ensure that you have the owner's permission.
146Would you like to commit this change?
147Enter "y" or "n" (or just press <return> for "n"): Sending        .
148Sending        lib/python/info/__init__.py
149Committed revision 10.
150Updating '.':
151At revision 10.
152__OUT__
153file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
154#-------------------------------------------------------------------------------
155# Tests fcm log of fcm merge (1)
156TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-1-log
157run_pass "$TEST_KEY" fcm log
158sed -i "s/\(.*|.*|\).*\(|.*\)$/\1 date \2/g" $TEST_DIR/$TEST_KEY.out
159file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
160------------------------------------------------------------------------
161r10 | $LOGNAME | date | 3 lines
162
163foo
164Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@9 cf. /${PROJECT}trunk@1
165
166------------------------------------------------------------------------
167r5 | $LOGNAME | date | 1 line
168
169Made changes for future merge of this branch
170------------------------------------------------------------------------
171r4 | $LOGNAME | date | 1 line
172
173Made a branch Created /${PROJECT}branches/dev/Share/merge1 from /trunk@1.
174------------------------------------------------------------------------
175r1 | $LOGNAME | date | 1 line
176
177initial trunk import
178------------------------------------------------------------------------
179__OUT__
180file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
181#-------------------------------------------------------------------------------
182# Test the various mergeinfo output after merging.
183test_mergeinfo "$TEST_KEY_BASE-trunk-into-branch-1-post" \
184    $ROOT_URL/trunk - 10 <<__RESULTS__
185begin-prop
186/trunk:2-9
187end-prop
188begin-info
189    youngest common ancestor
190    |         last full merge
191    |         |        tip of branch
192    |         |        |         repository path
193
194    1         9        10     
195    |         |        |       
196  -------| |------------         trunk
197     \         \              
198      \         \              
199       --| |------------         branches/dev/Share/merge1
200                       |       
201                       WC     
202end-info
203begin-eligible
204end-eligible
205begin-merged
206r8
207r9
208end-merged
209__RESULTS__
210#-------------------------------------------------------------------------------
211# Tests fcm merge of branch-into-trunk (1)
212TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-1
213BRANCH_MOD_FILE="added_directory/hello_constants_dummy.inc"
214echo "# added this line for simple repeat testing" >>$BRANCH_MOD_FILE
215svn commit -q -m "edit on branch for merge repeat test"
216svn update -q
217cd $TEST_DIR
218rm -rf $TEST_DIR/wc
219mkdir $TEST_DIR/wc
220svn checkout -q $ROOT_URL/trunk $TEST_DIR/wc
221cd $TEST_DIR/wc
222#-------------------------------------------------------------------------------
223# Test the various mergeinfo output before merging.
224test_mergeinfo "$TEST_KEY_BASE-branch-into-trunk-1-pre" \
225    $ROOT_URL/branches/dev/Share/merge1 - 11 <<__RESULTS__
226begin-prop
227end-prop
228begin-info
229    youngest common ancestor
230    |         last full merge
231    |         |        tip of branch
232    |         |        |         repository path
233
234    1                  11     
235    |                  |       
236       --| |------------         branches/dev/Share/merge1
237      /         /             
238     /         /               
239  -------| |------------         trunk
240              |        |       
241              9        WC     
242end-info
243begin-eligible
244r5
245r10
246r11
247end-eligible
248begin-merged
249end-merged
250__RESULTS__
251#-------------------------------------------------------------------------------
252TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-1
253run_pass "$TEST_KEY" fcm merge --non-interactive branches/dev/Share/merge1
254merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
255file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
256Eligible merge(s) from /${PROJECT}branches/dev/Share/merge1@11: 11 10
257--------------------------------------------------------------------------------
258Merge: /${PROJECT}branches/dev/Share/merge1@11
259 c.f.: /${PROJECT}trunk@9
260Merge succeeded.
261--------------------------------------------------------------------------actual
262--- Merging differences between repository URLs into '.':
263A    added_directory
264A    added_directory/hello_constants.f90
265A    added_directory/hello_constants.inc
266A    added_directory/hello_constants_dummy.inc
267A    added_file
268A    module/tree_conflict_file
269U    lib/python/info/poems.py
270U    module/hello_constants.f90
271U    module/hello_constants.inc
272U    module/hello_constants_dummy.inc
273U    subroutine/hello_sub_dummy.h
274--- Recording mergeinfo for merge between repository URLs into '.':
275 U   .
276--------------------------------------------------------------------------actual
277__OUT__
278file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
279#-------------------------------------------------------------------------------
280# Tests svn status result of fcm merge (1)
281TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-1-status
282run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
283status_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
284file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
285 M      .
286A  +    added_directory
287A  +    added_file
288A  +    module/tree_conflict_file
289M       lib/python/info/poems.py
290M       module/hello_constants.f90
291M       module/hello_constants.inc
292M       module/hello_constants_dummy.inc
293M       subroutine/hello_sub_dummy.h
294__OUT__
295file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
296#-------------------------------------------------------------------------------
297# Tests svn diff result of fcm merge (1)
298TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-1-diff
299run_pass "$TEST_KEY" svn diff
300diff_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
301diff_svn_version_filter >"$TEST_DIR/$TEST_KEY.sorted.ctrl" <<__OUT__
302
303Index: .
304===================================================================
305--- . (revision 11)
306+++ . (working copy)
307
308Property changes on: .
309___________________________________________________________________
310Added: svn:mergeinfo
311#IF SVN1.9 ## -0,0 +0,1 ##
312   Merged /${PROJECT}branches/dev/Share/merge1:r4-11
313#IF SVN1.9 Index: added_directory/hello_constants.f90
314#IF SVN1.9 ===================================================================
315#IF SVN1.9 Index: added_directory/hello_constants.inc
316#IF SVN1.9 ===================================================================
317#IF SVN1.9 Index: added_directory/hello_constants_dummy.inc
318#IF SVN1.9 ===================================================================
319#IF SVN1.9 Index: added_file
320#IF SVN1.9 ===================================================================
321Index: lib/python/info/poems.py
322===================================================================
323--- lib/python/info/poems.py  (revision 11)
324+++ lib/python/info/poems.py  (working copy)
325@@ -1,24 +1,23 @@
326-#!/usr/bin/env python
327-# -*- coding: utf-8 -*-
328 """The Python, by Hilaire Belloc
329 
330 A Python I should not advise,--
331-It needs a doctor for its eyes,
332+It needs a doctor FOR its eyes,
333 And has the measles yearly.
334-However, if you feel inclined
335-To get one (to improve your mind,
336+However, if you feel INclINed
337+To get one (
338+to improve your mINd,
339 And not from fashion merely),
340 Allow no music near its cage;
341-And when it flies into a rage
342+And when it flies INto a rage
343 Chastise it, most severely.
344-I had an aunt in Yucatan
345+I had an aunt IN Yucatan
346 Who bought a Python from a man
347-And kept it for a pet.
348+And kept it FOR a pet.
349 She died, because she never knew
350 These simple little rules and few;--
351-The Snake is living yet.
352+The Snake is livINg yet.
353 """
354 
355 import this
356 
357-print "\n",  __doc__
358+prINt "\n",  __doc__
359Index: module/hello_constants.f90
360===================================================================
361--- module/hello_constants.f90   (revision 11)
362+++ module/hello_constants.f90   (working copy)
363@@ -1,5 +1,5 @@
364 MODULE Hello_Constants
365 
366-INCLUDE 'hello_constants_dummy.inc'
367+INCLUDE 'hello_constants_dummy.INc'
368 
369 END MODULE Hello_Constants
370Index: module/hello_constants.inc
371===================================================================
372--- module/hello_constants.inc   (revision 11)
373+++ module/hello_constants.inc   (working copy)
374@@ -1 +1,2 @@
375-CHARACTER (LEN=80), PARAMETER :: hello_string = 'Hello Earth!'
376+CHARACTER (
377+LEN=80), PARAMETER :: hello_strINg = 'Hello Earth!!'
378Index: module/hello_constants_dummy.inc
379===================================================================
380--- module/hello_constants_dummy.inc   (revision 11)
381+++ module/hello_constants_dummy.inc   (working copy)
382@@ -1 +1 @@
383-INCLUDE 'hello_constants.inc'
384+INCLUDE 'hello_constants.INc'
385#IF SVN1.9 Index: module/tree_conflict_file
386#IF SVN1.9 ===================================================================
387Index: subroutine/hello_sub_dummy.h
388===================================================================
389--- subroutine/hello_sub_dummy.h (revision 11)
390+++ subroutine/hello_sub_dummy.h (working copy)
391@@ -1 +1,2 @@
392 #include "hello_sub.h"
393+Modified a line
394__OUT__
395file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" \
396    "$TEST_DIR/$TEST_KEY.sorted.ctrl"
397file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
398#-------------------------------------------------------------------------------
399# Tests fcm commit of fcm merge (1)
400TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-1-commit
401run_pass "$TEST_KEY" fcm commit <<__IN__
402y
403__IN__
404commit_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
405file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
406[info] sed -i 1i\foo: starting commit message editor...
407Change summary:
408--------------------------------------------------------------------------------
409[Root   : $REPOS_URL]
410[Project: ${TEST_PROJECT:-}]
411[Branch : trunk]
412[Sub-dir: ]
413 M      .
414A  +    added_directory
415A  +    added_file
416A  +    module/tree_conflict_file
417M       lib/python/info/poems.py
418M       module/hello_constants.f90
419M       module/hello_constants.inc
420M       module/hello_constants_dummy.inc
421M       subroutine/hello_sub_dummy.h
422--------------------------------------------------------------------------------
423Commit message is as follows:
424--------------------------------------------------------------------------------
425foo
426Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@11 cf. /${PROJECT}trunk@9
427--------------------------------------------------------------------------------
428*** WARNING: YOU ARE COMMITTING TO THE TRUNK.
429*** Please ensure that your change conforms to your project's working practices.
430Would you like to commit this change?
431Enter "y" or "n" (or just press <return> for "n"): Sending        .
432Adding         added_directory
433Adding         added_file
434Adding         module/tree_conflict_file
435Sending        lib/python/info/poems.py
436Sending        module/hello_constants.f90
437Sending        module/hello_constants.inc
438Sending        module/hello_constants_dummy.inc
439Sending        subroutine/hello_sub_dummy.h
440Committed revision 12.
441Updating '.':
442At revision 12.
443__OUT__
444file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
445#-------------------------------------------------------------------------------
446# Tests fcm log of fcm merge branch-into-trunk (1)
447TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-1-log
448run_pass "$TEST_KEY" fcm log
449sed -i "s/\(.*|.*|\).*\(|.*\)$/\1 date \2/g" $TEST_DIR/$TEST_KEY.out
450file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
451------------------------------------------------------------------------
452r12 | $LOGNAME | date | 3 lines
453
454foo
455Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@11 cf. /${PROJECT}trunk@9
456
457------------------------------------------------------------------------
458r9 | $LOGNAME | date | 1 line
459
460Made another trunk change
461------------------------------------------------------------------------
462r8 | $LOGNAME | date | 1 line
463
464Made trunk change
465------------------------------------------------------------------------
466r1 | $LOGNAME | date | 1 line
467
468initial trunk import
469------------------------------------------------------------------------
470__OUT__
471file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
472#-------------------------------------------------------------------------------
473# Test the various mergeinfo output after merging.
474test_mergeinfo "$TEST_KEY_BASE-branch-into-trunk-1-post" \
475    $ROOT_URL/branches/dev/Share/merge1 - 12 <<__RESULTS__
476begin-prop
477/branches/dev/Share/merge1:4-11
478end-prop
479begin-info
480    youngest common ancestor
481    |         last full merge
482    |         |        tip of branch
483    |         |        |         repository path
484
485    1         11       12     
486    |         |        |       
487       --| |------------         branches/dev/Share/merge1
488      /        \              
489     /          \              
490  -------| |------------         trunk
491                       |       
492                       WC     
493end-info
494begin-eligible
495end-eligible
496begin-merged
497r4
498r5
499r10
500r11
501end-merged
502__RESULTS__
503#-------------------------------------------------------------------------------
504# Tests fcm merge of branch-into-trunk (2)
505svn switch -q $ROOT_URL/branches/dev/Share/merge1
506MOD_FILE="added_file"
507echo "call_extra_feature()" >>$MOD_FILE
508svn commit -q -m "Made branch change to add extra feature"
509svn update -q
510# Create a new branch to up the revision number, as a test.
511init_branch merge3 $REPOS_URL
512# Checkout the trunk.
513svn switch -q $ROOT_URL/trunk
514#-------------------------------------------------------------------------------
515# Test the various mergeinfo output before merging.
516test_mergeinfo "$TEST_KEY_BASE-branch-into-trunk-2-pre" \
517    $ROOT_URL/branches/dev/Share/merge1 - 14 <<__RESULTS__
518begin-prop
519/branches/dev/Share/merge1:4-11
520end-prop
521begin-info
522    youngest common ancestor
523    |         last full merge
524    |         |        tip of branch
525    |         |        |         repository path
526
527    1         11       14     
528    |         |        |       
529       --| |------------         branches/dev/Share/merge1
530      /        \              
531     /          \              
532  -------| |------------         trunk
533                       |       
534                       WC     
535end-info
536begin-eligible
537r13
538end-eligible
539begin-merged
540r4
541r5
542r10
543r11
544end-merged
545__RESULTS__
546#-------------------------------------------------------------------------------
547TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-2
548run_pass "$TEST_KEY" fcm merge --non-interactive branches/dev/Share/merge1
549file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
550Eligible merge(s) from /${PROJECT}branches/dev/Share/merge1@14: 13
551--------------------------------------------------------------------------------
552Merge: /${PROJECT}branches/dev/Share/merge1@13
553 c.f.: /${PROJECT}branches/dev/Share/merge1@11
554Merge succeeded.
555--------------------------------------------------------------------------actual
556--- Merging r12 through r13 into '.':
557U    added_file
558--- Recording mergeinfo for merge of r12 through r13 into '.':
559 U   .
560--------------------------------------------------------------------------actual
561__OUT__
562file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
563#-------------------------------------------------------------------------------
564# Tests svn status result of fcm merge branch-into-trunk (2)
565TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-2-status
566run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
567file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
568 M      .
569M       added_file
570__OUT__
571file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
572#-------------------------------------------------------------------------------
573# Tests svn diff result of fcm merge branch-into-trunk (2)
574TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-2-diff
575run_pass "$TEST_KEY" svn diff
576diff_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
577diff_svn_version_filter >"$TEST_DIR/$TEST_KEY.sorted.ctrl" <<__OUT__
578
579Index: .
580===================================================================
581--- . (revision 14)
582+++ . (working copy)
583
584Property changes on: .
585___________________________________________________________________
586Modified: svn:mergeinfo
587#IF SVN1.9 ## -0,0 +0,1 ##
588   Merged /${PROJECT}branches/dev/Share/merge1:r12-13
589Index: added_file
590===================================================================
591--- added_file (revision 14)
592+++ added_file (working copy)
593@@ -1 +1,2 @@
594 INCLUDE 'hello_constants.INc'
595+call_extra_feature()
596__OUT__
597file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" \
598    "$TEST_DIR/$TEST_KEY.sorted.ctrl"
599file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
600#-------------------------------------------------------------------------------
601# Tests fcm commit of fcm merge branch-into-trunk (2)
602TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-2-commit
603run_pass "$TEST_KEY" fcm commit <<__IN__
604y
605__IN__
606sed -i "/^Updating '.':$/d" "$TEST_DIR/$TEST_KEY.out"
607commit_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
608file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
609[info] sed -i 1i\foo: starting commit message editor...
610Change summary:
611--------------------------------------------------------------------------------
612[Root   : $REPOS_URL]
613[Project: ${TEST_PROJECT:-}]
614[Branch : trunk]
615[Sub-dir: ]
616 M      .
617M       added_file
618--------------------------------------------------------------------------------
619Commit message is as follows:
620--------------------------------------------------------------------------------
621foo
622Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@13 cf. /${PROJECT}branches/dev/Share/merge1@11
623--------------------------------------------------------------------------------
624*** WARNING: YOU ARE COMMITTING TO THE TRUNK.
625*** Please ensure that your change conforms to your project's working practices.
626Would you like to commit this change?
627Enter "y" or "n" (or just press <return> for "n"): Sending        .
628Sending        added_file
629Committed revision 15.
630At revision 15.
631__OUT__
632file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
633#-------------------------------------------------------------------------------
634# Tests fcm log of fcm merge branch-into-trunk (2)
635TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-2-log
636run_pass "$TEST_KEY" fcm log
637sed -i "s/\(.*|.*|\).*\(|.*\)$/\1 date \2/g" $TEST_DIR/$TEST_KEY.out
638file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
639------------------------------------------------------------------------
640r15 | $LOGNAME | date | 3 lines
641
642foo
643Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@13 cf. /${PROJECT}branches/dev/Share/merge1@11
644
645------------------------------------------------------------------------
646r12 | $LOGNAME | date | 3 lines
647
648foo
649Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@11 cf. /${PROJECT}trunk@9
650
651------------------------------------------------------------------------
652r9 | $LOGNAME | date | 1 line
653
654Made another trunk change
655------------------------------------------------------------------------
656r8 | $LOGNAME | date | 1 line
657
658Made trunk change
659------------------------------------------------------------------------
660r1 | $LOGNAME | date | 1 line
661
662initial trunk import
663------------------------------------------------------------------------
664__OUT__
665file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
666#-------------------------------------------------------------------------------
667# Test the various mergeinfo output after merging.
668test_mergeinfo "$TEST_KEY_BASE-branch-into-trunk-2-post" \
669    $ROOT_URL/branches/dev/Share/merge1 - 15 <<__RESULTS__
670begin-prop
671/branches/dev/Share/merge1:4-13
672end-prop
673begin-info
674    youngest common ancestor
675    |         last full merge
676    |         |        tip of branch
677    |         |        |         repository path
678
679    1         13       15     
680    |         |        |       
681       --| |------------         branches/dev/Share/merge1
682      /        \              
683     /          \              
684  -------| |------------         trunk
685                       |       
686                       WC     
687end-info
688begin-eligible
689end-eligible
690begin-merged
691r4
692r5
693r10
694r11
695r13
696end-merged
697__RESULTS__
698#-------------------------------------------------------------------------------
699# Tests fcm merge of trunk-into-branch (2)
700echo "# trunk modification" >>$MOD_FILE
701svn commit -q -m "Made trunk change - a simple edit of $MOD_FILE"
702svn update -q
703svn switch -q $ROOT_URL/branches/dev/Share/merge1
704
705echo "# added another line for simple repeat testing" >>$BRANCH_MOD_FILE
706svn commit -q -m "Made branch change for merge repeat test"
707svn update -q
708#------------------------------------------------------------------------------
709# Test the various mergeinfo output before merging.
710test_mergeinfo "$TEST_KEY_BASE-trunk-into-branch-2-pre" \
711    $ROOT_URL/trunk - 17 <<__RESULTS__
712begin-prop
713/trunk:2-9
714end-prop
715begin-info
716    youngest common ancestor
717    |         last full merge
718    |         |        tip of branch
719    |         |        |         repository path
720
721    1                  17     
722    |                  |       
723  -------| |------------         trunk
724     \          /             
725      \        /               
726       --| |------------         branches/dev/Share/merge1
727              |        |       
728              13       WC     
729end-info
730begin-eligible
731r12
732r15
733r16
734end-eligible
735begin-merged
736r8
737r9
738end-merged
739__RESULTS__
740#------------------------------------------------------------------------------
741TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-2
742run_pass "$TEST_KEY" fcm merge --non-interactive trunk
743file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
744Eligible merge(s) from /${PROJECT}trunk@17: 16 15
745--------------------------------------------------------------------------------
746Merge: /${PROJECT}trunk@16
747 c.f.: /${PROJECT}branches/dev/Share/merge1@13
748Merge succeeded.
749--------------------------------------------------------------------------actual
750--- Merging differences between repository URLs into '.':
751U    added_file
752--- Recording mergeinfo for merge between repository URLs into '.':
753 U   .
754--------------------------------------------------------------------------actual
755__OUT__
756file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
757#-------------------------------------------------------------------------------
758# Tests svn status result of fcm merge trunk-into-branch (2)
759TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-2-status
760run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
761file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
762 M      .
763M       added_file
764__OUT__
765file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
766#-------------------------------------------------------------------------------
767# Tests svn diff result of fcm merge trunk-into-branch (2)
768TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-2-diff
769run_pass "$TEST_KEY" svn diff
770diff_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
771diff_svn_version_filter >"$TEST_DIR/$TEST_KEY.sorted.ctrl" <<__OUT__
772
773Index: .
774===================================================================
775--- . (revision 17)
776+++ . (working copy)
777
778Property changes on: .
779___________________________________________________________________
780Modified: svn:mergeinfo
781#IF SVN1.9 ## -0,0 +0,1 ##
782   Merged /${PROJECT}trunk:r10-16
783Index: added_file
784===================================================================
785--- added_file (revision 17)
786+++ added_file (working copy)
787@@ -1,2 +1,3 @@
788 INCLUDE 'hello_constants.INc'
789 call_extra_feature()
790+# trunk modification
791__OUT__
792file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" \
793    "$TEST_DIR/$TEST_KEY.sorted.ctrl"
794file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
795#-------------------------------------------------------------------------------
796# Tests fcm commit of fcm merge trunk-into-branch (2)
797TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-2-commit
798run_pass "$TEST_KEY" fcm commit <<__IN__
799y
800__IN__
801sed -i "/^Updating '.':$/d" "$TEST_DIR/$TEST_KEY.out"
802commit_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
803file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
804[info] sed -i 1i\foo: starting commit message editor...
805Change summary:
806--------------------------------------------------------------------------------
807[Root   : $REPOS_URL]
808[Project: ${TEST_PROJECT:-}]
809[Branch : branches/dev/Share/merge1]
810[Sub-dir: ]
811 M      .
812M       added_file
813--------------------------------------------------------------------------------
814Commit message is as follows:
815--------------------------------------------------------------------------------
816foo
817Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@16 cf. /${PROJECT}branches/dev/Share/merge1@13
818--------------------------------------------------------------------------------
819*** WARNING: YOU ARE COMMITTING TO A Share BRANCH.
820*** Please ensure that you have the owner's permission.
821Would you like to commit this change?
822Enter "y" or "n" (or just press <return> for "n"): Sending        .
823Sending        added_file
824Committed revision 18.
825At revision 18.
826__OUT__
827file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
828#-------------------------------------------------------------------------------
829# Tests fcm log of fcm merge trunk-into-branch (2)
830TEST_KEY=$TEST_KEY_BASE-trunk-into-branch-2-log
831run_pass "$TEST_KEY" fcm log
832sed -i "s/\(.*|.*|\).*\(|.*\)$/\1 date \2/g" $TEST_DIR/$TEST_KEY.out
833file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
834------------------------------------------------------------------------
835r18 | $LOGNAME | date | 3 lines
836
837foo
838Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@16 cf. /${PROJECT}branches/dev/Share/merge1@13
839
840------------------------------------------------------------------------
841r17 | $LOGNAME | date | 1 line
842
843Made branch change for merge repeat test
844------------------------------------------------------------------------
845r13 | $LOGNAME | date | 1 line
846
847Made branch change to add extra feature
848------------------------------------------------------------------------
849r11 | $LOGNAME | date | 1 line
850
851edit on branch for merge repeat test
852------------------------------------------------------------------------
853r10 | $LOGNAME | date | 3 lines
854
855foo
856Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@9 cf. /${PROJECT}trunk@1
857
858------------------------------------------------------------------------
859r5 | $LOGNAME | date | 1 line
860
861Made changes for future merge of this branch
862------------------------------------------------------------------------
863r4 | $LOGNAME | date | 1 line
864
865Made a branch Created /${PROJECT}branches/dev/Share/merge1 from /trunk@1.
866------------------------------------------------------------------------
867r1 | $LOGNAME | date | 1 line
868
869initial trunk import
870------------------------------------------------------------------------
871__OUT__
872file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
873#-------------------------------------------------------------------------------
874# Test the various mergeinfo output after merging.
875test_mergeinfo "$TEST_KEY_BASE-trunk-into-branch-2-post" \
876    $ROOT_URL/trunk - 18 <<__RESULTS__
877begin-prop
878/trunk:2-16
879end-prop
880begin-info
881    youngest common ancestor
882    |         last full merge
883    |         |        tip of branch
884    |         |        |         repository path
885
886    1         16       18     
887    |         |        |       
888  -------| |------------         trunk
889     \         \              
890      \         \              
891       --| |------------         branches/dev/Share/merge1
892                       |       
893                       WC     
894end-info
895begin-eligible
896end-eligible
897begin-merged
898r8
899r9
900r12
901r15
902r16
903end-merged
904__RESULTS__
905#-------------------------------------------------------------------------------
906# Tests fcm merge of branch-into-trunk (3)
907svn delete -q $BRANCH_MOD_FILE
908svn copy -q $MOD_FILE $MOD_FILE.add
909svn commit -q -m "Made branch change - deleted $BRANCH_MOD_FILE, copied $MOD_FILE"
910svn update -q
911svn switch -q $ROOT_URL/trunk
912#-------------------------------------------------------------------------------
913# Test the various mergeinfo output before merging.
914test_mergeinfo "$TEST_KEY_BASE-branch-into-trunk-3-pre" \
915    $ROOT_URL/branches/dev/Share/merge1 - 19 <<__RESULTS__
916begin-prop
917/branches/dev/Share/merge1:4-13
918end-prop
919begin-info
920    youngest common ancestor
921    |         last full merge
922    |         |        tip of branch
923    |         |        |         repository path
924
925    1                  19     
926    |                  |       
927       --| |------------         branches/dev/Share/merge1
928      /         /             
929     /         /               
930  -------| |------------         trunk
931              |        |       
932              16       WC     
933end-info
934begin-eligible
935r17
936r18
937r19
938end-eligible
939begin-merged
940r4
941r5
942r10
943r11
944r13
945end-merged
946__RESULTS__
947#-------------------------------------------------------------------------------
948TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-3
949run_pass "$TEST_KEY" fcm merge --non-interactive branches/dev/Share/merge1
950file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
951Eligible merge(s) from /${PROJECT}branches/dev/Share/merge1@19: 19 18
952--------------------------------------------------------------------------------
953Merge: /${PROJECT}branches/dev/Share/merge1@19
954 c.f.: /${PROJECT}trunk@16
955Merge succeeded.
956--------------------------------------------------------------------------actual
957--- Merging differences between repository URLs into '.':
958D    added_directory/hello_constants_dummy.inc
959A    added_file.add
960--- Recording mergeinfo for merge between repository URLs into '.':
961 U   .
962--------------------------------------------------------------------------actual
963__OUT__
964file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
965#-------------------------------------------------------------------------------
966# Tests svn status result of fcm merge branch-into-trunk (3)
967TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-3-status
968run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
969file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
970 M      .
971D       added_directory/hello_constants_dummy.inc
972A  +    added_file.add
973__OUT__
974file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
975#-------------------------------------------------------------------------------
976# Tests svn diff result of fcm merge branch-into-trunk (3)
977TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-3-diff
978run_pass "$TEST_KEY" svn diff
979diff_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
980diff_svn_version_filter >"$TEST_DIR/$TEST_KEY.sorted.ctrl" <<__OUT__
981
982Index: .
983===================================================================
984--- . (revision 19)
985+++ . (working copy)
986
987Property changes on: .
988___________________________________________________________________
989Modified: svn:mergeinfo
990#IF SVN1.9 ## -0,0 +0,1 ##
991   Merged /${PROJECT}branches/dev/Share/merge1:r14-19
992Index: added_directory/hello_constants_dummy.inc
993===================================================================
994--- added_directory/hello_constants_dummy.inc   (revision 19)
995+++ added_directory/hello_constants_dummy.inc   (working copy)
996@@ -1,2 +0,0 @@
997-INCLUDE 'hello_constants.INc'
998-# added this line for simple repeat testing
999#IF SVN1.9 Index: added_file.add
1000#IF SVN1.9 ===================================================================
1001__OUT__
1002file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" \
1003    "$TEST_DIR/$TEST_KEY.sorted.ctrl"
1004file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1005#-------------------------------------------------------------------------------
1006# Tests fcm commit of fcm merge branch-into-trunk (3)
1007TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-3-commit
1008run_pass "$TEST_KEY" fcm commit <<__IN__
1009y
1010__IN__
1011sed -i "/^Updating '.':$/d" $TEST_DIR/"$TEST_KEY.out"
1012commit_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
1013file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
1014[info] sed -i 1i\foo: starting commit message editor...
1015Change summary:
1016--------------------------------------------------------------------------------
1017[Root   : $REPOS_URL]
1018[Project: ${TEST_PROJECT:-}]
1019[Branch : trunk]
1020[Sub-dir: ]
1021 M      .
1022A  +    added_file.add
1023D       added_directory/hello_constants_dummy.inc
1024--------------------------------------------------------------------------------
1025Commit message is as follows:
1026--------------------------------------------------------------------------------
1027foo
1028Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@19 cf. /${PROJECT}trunk@16
1029--------------------------------------------------------------------------------
1030*** WARNING: YOU ARE COMMITTING TO THE TRUNK.
1031*** Please ensure that your change conforms to your project's working practices.
1032Would you like to commit this change?
1033Enter "y" or "n" (or just press <return> for "n"): Sending        .
1034Adding         added_file.add
1035Deleting       added_directory/hello_constants_dummy.inc
1036Committed revision 20.
1037At revision 20.
1038__OUT__
1039file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1040#-------------------------------------------------------------------------------
1041# Tests fcm log of fcm merge branch-into-trunk (3)
1042TEST_KEY=$TEST_KEY_BASE-branch-into-trunk-3-log
1043run_pass "$TEST_KEY" fcm log $ROOT_URL
1044sed -i "s/\(.*|.*|\).*\(|.*\)$/\1 date \2/g" $TEST_DIR/$TEST_KEY.out
1045file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
1046------------------------------------------------------------------------
1047r20 | $LOGNAME | date | 3 lines
1048
1049foo
1050Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@19 cf. /${PROJECT}trunk@16
1051
1052------------------------------------------------------------------------
1053r19 | $LOGNAME | date | 1 line
1054
1055Made branch change - deleted added_directory/hello_constants_dummy.inc, copied added_file
1056------------------------------------------------------------------------
1057r18 | $LOGNAME | date | 3 lines
1058
1059foo
1060Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@16 cf. /${PROJECT}branches/dev/Share/merge1@13
1061
1062------------------------------------------------------------------------
1063r17 | $LOGNAME | date | 1 line
1064
1065Made branch change for merge repeat test
1066------------------------------------------------------------------------
1067r16 | $LOGNAME | date | 1 line
1068
1069Made trunk change - a simple edit of added_file
1070------------------------------------------------------------------------
1071r15 | $LOGNAME | date | 3 lines
1072
1073foo
1074Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@13 cf. /${PROJECT}branches/dev/Share/merge1@11
1075
1076------------------------------------------------------------------------
1077r14 | $LOGNAME | date | 1 line
1078
1079Made a branch Created /branches/dev/Share/merge3 from /trunk@1.
1080------------------------------------------------------------------------
1081r13 | $LOGNAME | date | 1 line
1082
1083Made branch change to add extra feature
1084------------------------------------------------------------------------
1085r12 | $LOGNAME | date | 3 lines
1086
1087foo
1088Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@11 cf. /${PROJECT}trunk@9
1089
1090------------------------------------------------------------------------
1091r11 | $LOGNAME | date | 1 line
1092
1093edit on branch for merge repeat test
1094------------------------------------------------------------------------
1095r10 | $LOGNAME | date | 3 lines
1096
1097foo
1098Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@9 cf. /${PROJECT}trunk@1
1099
1100------------------------------------------------------------------------
1101r9 | $LOGNAME | date | 1 line
1102
1103Made another trunk change
1104------------------------------------------------------------------------
1105r8 | $LOGNAME | date | 1 line
1106
1107Made trunk change
1108------------------------------------------------------------------------
1109r7 | $LOGNAME | date | 1 line
1110
1111Made changes for future merge
1112------------------------------------------------------------------------
1113r6 | $LOGNAME | date | 1 line
1114
1115Made a branch Created /${PROJECT}branches/dev/Share/merge2 from /trunk@1.
1116------------------------------------------------------------------------
1117r5 | $LOGNAME | date | 1 line
1118
1119Made changes for future merge of this branch
1120------------------------------------------------------------------------
1121r4 | $LOGNAME | date | 1 line
1122
1123Made a branch Created /${PROJECT}branches/dev/Share/merge1 from /trunk@1.
1124------------------------------------------------------------------------
1125r3 | $LOGNAME | date | 1 line
1126
1127 
1128------------------------------------------------------------------------
1129r2 | $LOGNAME | date | 1 line
1130
1131make tags
1132------------------------------------------------------------------------
1133r1 | $LOGNAME | date | 1 line
1134
1135initial trunk import
1136------------------------------------------------------------------------
1137__OUT__
1138file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1139#-------------------------------------------------------------------------------
1140# Test the various mergeinfo output after merging.
1141test_mergeinfo "$TEST_KEY_BASE-branch-into-trunk-3-post" \
1142    $ROOT_URL/branches/dev/Share/merge1 - 20 <<__RESULTS__
1143begin-prop
1144/branches/dev/Share/merge1:4-19
1145end-prop
1146begin-info
1147    youngest common ancestor
1148    |         last full merge
1149    |         |        tip of branch
1150    |         |        |         repository path
1151
1152    1         19       20     
1153    |         |        |       
1154       --| |------------         branches/dev/Share/merge1
1155      /        \              
1156     /          \              
1157  -------| |------------         trunk
1158                       |       
1159                       WC     
1160end-info
1161begin-eligible
1162end-eligible
1163begin-merged
1164r4
1165r5
1166r10
1167r11
1168r13
1169r17
1170r18
1171r19
1172end-merged
1173__RESULTS__
1174#-------------------------------------------------------------------------------
1175# Tests fcm merge of branch-into-branch (1)
1176cd $TEST_DIR
1177rm -rf $TEST_DIR/wc
1178mkdir $TEST_DIR/wc
1179svn checkout -q $ROOT_URL/branches/dev/Share/merge2 $TEST_DIR/wc
1180cd $TEST_DIR/wc
1181BRANCH_2_MOD_FILE="module/hello_constants.f90"
1182echo "Second branch change" >>$BRANCH_2_MOD_FILE
1183svn commit -q -m "Made branch change - added to $BRANCH_2_MOD_FILE"
1184svn update -q
1185#------------------------------------------------------------------------------
1186# Test the various mergeinfo output before merging.
1187test_mergeinfo "$TEST_KEY_BASE-branch-into-branch-1-pre" \
1188    $ROOT_URL/branches/dev/Share/merge1 - 21 <<__RESULTS__
1189begin-prop
1190end-prop
1191begin-info
1192    youngest common ancestor
1193    |         last full merge
1194    |         |        tip of branch
1195    |         |        |         repository path
1196
1197    1                  21     
1198    |                  |       
1199       --| |------------         branches/dev/Share/merge1
1200  ... /                       
1201      \                        
1202       --| |------------         branches/dev/Share/merge2
1203                       |       
1204                       WC     
1205end-info
1206begin-eligible
1207r5
1208r10
1209r11
1210r13
1211r17
1212r18
1213r19
1214end-eligible
1215begin-merged
1216end-merged
1217__RESULTS__
1218#------------------------------------------------------------------------------
1219TEST_KEY=$TEST_KEY_BASE-branch-into-branch-1
1220run_pass "$TEST_KEY" fcm merge $ROOT_URL/branches/dev/Share/merge1 <<__IN__
122113
1222y
1223__IN__
1224merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
1225file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
1226Eligible merge(s) from /${PROJECT}branches/dev/Share/merge1@21: 19 18 17 13 11 10 5
1227Enter a revision (or just press <return> for "19"): --------------------------------------------------------------------------------
1228Merge: /${PROJECT}branches/dev/Share/merge1@13
1229 c.f.: /${PROJECT}trunk@1
1230-------------------------------------------------------------------------dry-run
1231--- Merging r4 through r13 into '.':
1232 U   .
1233A    added_directory
1234A    added_directory/hello_constants.f90
1235A    added_directory/hello_constants.inc
1236A    added_directory/hello_constants_dummy.inc
1237A    added_file
1238A    module/tree_conflict_file
1239U    lib/python/info/__init__.py
1240U    lib/python/info/poems.py
1241U    module/hello_constants.f90
1242U    module/hello_constants.inc
1243U    module/hello_constants_dummy.inc
1244U    subroutine/hello_sub_dummy.h
1245-------------------------------------------------------------------------dry-run
1246Would you like to go ahead with the merge?
1247Enter "y" or "n" (or just press <return> for "n"):
1248Merge succeeded.
1249--------------------------------------------------------------------------actual
1250--- Merging r4 through r13 into '.':
1251 U   .
1252A    added_directory
1253A    added_directory/hello_constants.f90
1254A    added_directory/hello_constants.inc
1255A    added_directory/hello_constants_dummy.inc
1256A    added_file
1257A    module/tree_conflict_file
1258U    lib/python/info/__init__.py
1259U    lib/python/info/poems.py
1260U    module/hello_constants.f90
1261U    module/hello_constants.inc
1262U    module/hello_constants_dummy.inc
1263U    subroutine/hello_sub_dummy.h
1264--- Recording mergeinfo for merge of r4 through r13 into '.':
1265 G   .
1266--------------------------------------------------------------------------actual
1267__OUT__
1268file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1269#-------------------------------------------------------------------------------
1270# Tests svn status result of fcm merge branch-into-branch (1)
1271TEST_KEY=$TEST_KEY_BASE-branch-into-branch-1-status
1272run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
1273status_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
1274file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
1275 M      .
1276A  +    added_directory
1277A  +    added_file
1278A  +    module/tree_conflict_file
1279M       lib/python/info/__init__.py
1280M       lib/python/info/poems.py
1281M       module/hello_constants.f90
1282M       module/hello_constants.inc
1283M       module/hello_constants_dummy.inc
1284M       subroutine/hello_sub_dummy.h
1285__OUT__
1286file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1287#-------------------------------------------------------------------------------
1288# Tests svn diff result of fcm merge branch-into-branch (1)
1289TEST_KEY=$TEST_KEY_BASE-branch-into-branch-1-diff
1290run_pass "$TEST_KEY" svn diff
1291diff_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
1292diff_svn_version_filter >"$TEST_DIR/$TEST_KEY.sorted.ctrl" <<__OUT__
1293
1294Index: .
1295===================================================================
1296--- . (revision 21)
1297+++ . (working copy)
1298
1299Property changes on: .
1300___________________________________________________________________
1301Added: svn:mergeinfo
1302#IF SVN1.9 ## -0,0 +0,2 ##
1303   Merged /${PROJECT}trunk:r2-9
1304   Merged /${PROJECT}branches/dev/Share/merge1:r4-13
1305#IF SVN1.9 Index: added_directory/hello_constants.f90
1306#IF SVN1.9 ===================================================================
1307#IF SVN1.9 Index: added_directory/hello_constants.inc
1308#IF SVN1.9 ===================================================================
1309#IF SVN1.9 Index: added_directory/hello_constants_dummy.inc
1310#IF SVN1.9 ===================================================================
1311#IF SVN1.9 Index: added_file
1312#IF SVN1.9 ===================================================================
1313Index: lib/python/info/__init__.py
1314===================================================================
1315--- lib/python/info/__init__.py  (revision 21)
1316+++ lib/python/info/__init__.py  (working copy)
1317@@ -0,0 +1,2 @@
1318+trunk change
1319+another trunk change
1320Index: lib/python/info/poems.py
1321===================================================================
1322--- lib/python/info/poems.py  (revision 21)
1323+++ lib/python/info/poems.py  (working copy)
1324@@ -1,24 +1,23 @@
1325-#!/usr/bin/env python
1326-# -*- coding: utf-8 -*-
1327 """The Python, by Hilaire Belloc
1328 
1329 A Python I should not advise,--
1330-It needs a doctor for its eyes,
1331+It needs a doctor FOR its eyes,
1332 And has the measles yearly.
1333-However, if you feel inclined
1334-To get one (to improve your mind,
1335+However, if you feel INclINed
1336+To get one (
1337+to improve your mINd,
1338 And not from fashion merely),
1339 Allow no music near its cage;
1340-And when it flies into a rage
1341+And when it flies INto a rage
1342 Chastise it, most severely.
1343-I had an aunt in Yucatan
1344+I had an aunt IN Yucatan
1345 Who bought a Python from a man
1346-And kept it for a pet.
1347+And kept it FOR a pet.
1348 She died, because she never knew
1349 These simple little rules and few;--
1350-The Snake is living yet.
1351+The Snake is livINg yet.
1352 """
1353 
1354 import this
1355 
1356-print "\n",  __doc__
1357+prINt "\n",  __doc__
1358Index: module/hello_constants.f90
1359===================================================================
1360--- module/hello_constants.f90   (revision 21)
1361+++ module/hello_constants.f90   (working copy)
1362@@ -1,6 +1,6 @@
1363 MODULE Hello_Constants
1364 
1365-INCLUDE 'hello_constants_dummy.inc'
1366+INCLUDE 'hello_constants_dummy.INc'
1367 
1368 END MODULE Hello_Constants
1369 Second branch change
1370Index: module/hello_constants.inc
1371===================================================================
1372--- module/hello_constants.inc   (revision 21)
1373+++ module/hello_constants.inc   (working copy)
1374@@ -1 +1,2 @@
1375-CHARACTER (LEN=80), PARAMETER :: hello_string = 'Hello Earth!'
1376+CHARACTER (
1377+LEN=80), PARAMETER :: hello_strINg = 'Hello Earth!!'
1378Index: module/hello_constants_dummy.inc
1379===================================================================
1380--- module/hello_constants_dummy.inc   (revision 21)
1381+++ module/hello_constants_dummy.inc   (working copy)
1382@@ -1 +1 @@
1383-INCLUDE 'hello_constants.inc'
1384+INCLUDE 'hello_constants.INc'
1385#IF SVN1.9 Index: module/tree_conflict_file
1386#IF SVN1.9 ===================================================================
1387Index: subroutine/hello_sub_dummy.h
1388===================================================================
1389--- subroutine/hello_sub_dummy.h (revision 21)
1390+++ subroutine/hello_sub_dummy.h (working copy)
1391@@ -1 +1,2 @@
1392 #include "hello_sub.h"
1393+Modified a line
1394__OUT__
1395file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" \
1396    "$TEST_DIR/$TEST_KEY.sorted.ctrl"
1397file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1398#-------------------------------------------------------------------------------
1399# Tests fcm commit of fcm merge branch-into-branch (1)
1400TEST_KEY=$TEST_KEY_BASE-branch-into-branch-1-commit
1401run_pass "$TEST_KEY" fcm commit <<__IN__
1402y
1403__IN__
1404commit_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
1405file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
1406[info] sed -i 1i\foo: starting commit message editor...
1407Change summary:
1408--------------------------------------------------------------------------------
1409[Root   : $REPOS_URL]
1410[Project: ${TEST_PROJECT:-}]
1411[Branch : branches/dev/Share/merge2]
1412[Sub-dir: ]
1413 M      .
1414A  +    added_directory
1415A  +    added_file
1416A  +    module/tree_conflict_file
1417M       lib/python/info/__init__.py
1418M       lib/python/info/poems.py
1419M       module/hello_constants.f90
1420M       module/hello_constants.inc
1421M       module/hello_constants_dummy.inc
1422M       subroutine/hello_sub_dummy.h
1423--------------------------------------------------------------------------------
1424Commit message is as follows:
1425--------------------------------------------------------------------------------
1426foo
1427Merged into /${PROJECT}branches/dev/Share/merge2: /${PROJECT}branches/dev/Share/merge1@13 cf. /${PROJECT}trunk@1
1428--------------------------------------------------------------------------------
1429*** WARNING: YOU ARE COMMITTING TO A Share BRANCH.
1430*** Please ensure that you have the owner's permission.
1431Would you like to commit this change?
1432Enter "y" or "n" (or just press <return> for "n"): Sending        .
1433Adding         added_directory
1434Adding         added_file
1435Adding         module/tree_conflict_file
1436Sending        lib/python/info/__init__.py
1437Sending        lib/python/info/poems.py
1438Sending        module/hello_constants.f90
1439Sending        module/hello_constants.inc
1440Sending        module/hello_constants_dummy.inc
1441Sending        subroutine/hello_sub_dummy.h
1442Committed revision 22.
1443Updating '.':
1444At revision 22.
1445__OUT__
1446file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1447#-------------------------------------------------------------------------------
1448# Tests fcm log of fcm merge branch-into-branch (1)
1449TEST_KEY=$TEST_KEY_BASE-branch-into-branch-1-log
1450run_pass "$TEST_KEY" fcm log $REPOS_URL
1451sed -i "s/\(.*|.*|\).*\(|.*\)$/\1 date \2/g" $TEST_DIR/$TEST_KEY.out
1452file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
1453------------------------------------------------------------------------
1454r22 | $LOGNAME | date | 3 lines
1455
1456foo
1457Merged into /${PROJECT}branches/dev/Share/merge2: /${PROJECT}branches/dev/Share/merge1@13 cf. /${PROJECT}trunk@1
1458
1459------------------------------------------------------------------------
1460r21 | $LOGNAME | date | 1 line
1461
1462Made branch change - added to module/hello_constants.f90
1463------------------------------------------------------------------------
1464r20 | $LOGNAME | date | 3 lines
1465
1466foo
1467Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@19 cf. /${PROJECT}trunk@16
1468
1469------------------------------------------------------------------------
1470r19 | $LOGNAME | date | 1 line
1471
1472Made branch change - deleted added_directory/hello_constants_dummy.inc, copied added_file
1473------------------------------------------------------------------------
1474r18 | $LOGNAME | date | 3 lines
1475
1476foo
1477Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@16 cf. /${PROJECT}branches/dev/Share/merge1@13
1478
1479------------------------------------------------------------------------
1480r17 | $LOGNAME | date | 1 line
1481
1482Made branch change for merge repeat test
1483------------------------------------------------------------------------
1484r16 | $LOGNAME | date | 1 line
1485
1486Made trunk change - a simple edit of added_file
1487------------------------------------------------------------------------
1488r15 | $LOGNAME | date | 3 lines
1489
1490foo
1491Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@13 cf. /${PROJECT}branches/dev/Share/merge1@11
1492
1493------------------------------------------------------------------------
1494r14 | $LOGNAME | date | 1 line
1495
1496Made a branch Created /branches/dev/Share/merge3 from /trunk@1.
1497------------------------------------------------------------------------
1498r13 | $LOGNAME | date | 1 line
1499
1500Made branch change to add extra feature
1501------------------------------------------------------------------------
1502r12 | $LOGNAME | date | 3 lines
1503
1504foo
1505Merged into /${PROJECT}trunk: /${PROJECT}branches/dev/Share/merge1@11 cf. /${PROJECT}trunk@9
1506
1507------------------------------------------------------------------------
1508r11 | $LOGNAME | date | 1 line
1509
1510edit on branch for merge repeat test
1511------------------------------------------------------------------------
1512r10 | $LOGNAME | date | 3 lines
1513
1514foo
1515Merged into /${PROJECT}branches/dev/Share/merge1: /${PROJECT}trunk@9 cf. /${PROJECT}trunk@1
1516
1517------------------------------------------------------------------------
1518r9 | $LOGNAME | date | 1 line
1519
1520Made another trunk change
1521------------------------------------------------------------------------
1522r8 | $LOGNAME | date | 1 line
1523
1524Made trunk change
1525------------------------------------------------------------------------
1526r7 | $LOGNAME | date | 1 line
1527
1528Made changes for future merge
1529------------------------------------------------------------------------
1530r6 | $LOGNAME | date | 1 line
1531
1532Made a branch Created /${PROJECT}branches/dev/Share/merge2 from /trunk@1.
1533------------------------------------------------------------------------
1534r5 | $LOGNAME | date | 1 line
1535
1536Made changes for future merge of this branch
1537------------------------------------------------------------------------
1538r4 | $LOGNAME | date | 1 line
1539
1540Made a branch Created /${PROJECT}branches/dev/Share/merge1 from /trunk@1.
1541------------------------------------------------------------------------
1542r3 | $LOGNAME | date | 1 line
1543
1544 
1545------------------------------------------------------------------------
1546r2 | $LOGNAME | date | 1 line
1547
1548make tags
1549------------------------------------------------------------------------
1550r1 | $LOGNAME | date | 1 line
1551
1552initial trunk import
1553------------------------------------------------------------------------
1554__OUT__
1555file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
1556#------------------------------------------------------------------------------
1557# Test the various mergeinfo output after merging.
1558test_mergeinfo "$TEST_KEY_BASE-branch-into-branch-1-post" \
1559    $ROOT_URL/branches/dev/Share/merge1 - 22 <<__RESULTS__
1560begin-prop
1561/branches/dev/Share/merge1:4-13
1562/trunk:2-9
1563end-prop
1564begin-info
1565    youngest common ancestor
1566    |         last full merge
1567    |         |        tip of branch
1568    |         |        |         repository path
1569
1570    1         13       22     
1571    |         |        |       
1572       --| |------------         branches/dev/Share/merge1
1573  ... /        \              
1574      \         \              
1575       --| |------------         branches/dev/Share/merge2
1576                       |       
1577                       WC     
1578end-info
1579begin-eligible
1580r17
1581r18
1582r19
1583end-eligible
1584begin-merged
1585r4
1586r5
1587r10
1588r11
1589r13
1590end-merged
1591__RESULTS__
1592
1593#-------------------------------------------------------------------------------
1594teardown
1595#-------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.