Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Adding a new test (this failed by current trunk) based on ticket [74413366fe].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | merge_renames
Files: files | file ages | folders
SHA1:b2e7370e32d8acc735170c6b1b68ec8fa0cd370e
User & Date: viric 2011-06-17 20:13:42
Context
2011-08-05
12:43
Taking a note about a new test I should write about merges with renames.. check-in: b78d9999 user: viriketo tags: merge_renames
2011-06-17
20:13
Adding a new test (this failed by current trunk) based on ticket [74413366fe]. check-in: b2e7370e user: viric tags: merge_renames
19:09
Adding a first test for merging branches with renames. Related to ticket [554f44ee74]. check-in: 8526b151 user: viriketo tags: merge_renames
Changes

Changes to test/merge_renames.test.

6
7
8
9
10
11
12
13
14

15
16
17
18
19
20
21
22
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
..
50
51
52
53
54
55
56
57
58
59






60
61


62








































63







64


65
66


catch {exec $::fossilexe info} res
puts res=$res
if {![regexp {not within an open checkout} $res]} {
  puts stderr "Cannot run this test within an open checkout"
  return
}

#################
#  Test 1       #

#################

fossil new rep.fossil
fossil open rep.fossil

write_file f1 "line"
fossil add f1
fossil commit -m "c1"
................................................................................
write_file f1 "line5"
fossil commit -m "c4"

write_file f1 "line6"
fossil commit -m "c4"

fossil update pivot
puts $RESULT
fossil mv f1 f2
exec mv f1 f2
fossil commit -b rename -m "c5"

fossil merge trunk
fossil commit -m "trunk merged"

................................................................................
write_file f3 "someline"
fossil add f3
fossil commit -b branch2 -m "newbranch"

fossil merge trunk
puts $RESULT

# Not a nice way to check, but I don't know more tcl now
foreach {status filename} $RESULT {
    if {$status=="DELETED"} {






        protOut "Error, the merge should not delete any file"
        test merge_renames-1 0


    }








































    if {$status=="UPDATE"} {







        test merge_renames-1 1


    }
}









|
|
>
|







 







<







 







|

|
>
>
>
>
>
>
|
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
>
|
|
>
>
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
35
36
37
38
39
40
41

42
43
44
45
46
47
48
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
catch {exec $::fossilexe info} res
puts res=$res
if {![regexp {not within an open checkout} $res]} {
  puts stderr "Cannot run this test within an open checkout"
  return
}

######################################
#  Test 1                            #
#  Reported: Ticket [554f44ee74e3d]  #
######################################

fossil new rep.fossil
fossil open rep.fossil

write_file f1 "line"
fossil add f1
fossil commit -m "c1"
................................................................................
write_file f1 "line5"
fossil commit -m "c4"

write_file f1 "line6"
fossil commit -m "c4"

fossil update pivot

fossil mv f1 f2
exec mv f1 f2
fossil commit -b rename -m "c5"

fossil merge trunk
fossil commit -m "trunk merged"

................................................................................
write_file f3 "someline"
fossil add f3
fossil commit -b branch2 -m "newbranch"

fossil merge trunk
puts $RESULT

set deletes 0
foreach {status filename} $RESULT {
    if {$status=="DELETE"} {
        set deletes [expr $deletes + 1]
    }
}

if {$deletes!=0} {
    # failed
    protOut "Error, the merge should not delete any file"
    test merge_renames-1 0
} else {
    test merge_renames-1 1
}

fossil close -f
exec rm rep.fossil

######################################
#  Test 2                            #
#  Reported: Ticket [74413366fe5067] #
######################################

fossil new rep.fossil
fossil open rep.fossil

write_file f1 "line"
fossil add f1
fossil commit -m "base file"
fossil tag add pivot current

write_file f2 "line2"
fossil add f2
fossil commit -m "newfile"

fossil mv f2 f2new
exec mv f2 f2new
fossil commit -m "rename"

fossil update pivot
write_file f1 "line3"
fossil commit -b branch -m "change"

fossil merge trunk
fossil commit -m "trunk merged"

fossil update trunk

fossil merge branch
puts $RESULT

# Not a nice way to check, but I don't know more tcl now
set deletes 0
foreach {status filename} $RESULT {
    if {$status=="DELETE"} {
        set deletes [expr $deletes + 1]
    }
}

if {$deletes!=0} {
    # failed
    protOut "Error, the merge should not delete any file"
    test merge_renames-2 0
} else {
    test merge_renames-2 1
}

fossil close -f
exec rm rep.fossil