Fossil

Diff
Login

Differences From Artifact [6fe77d49a7]:

To Artifact [7a35517172]:


9
10
11
12
13
14
15


16
17
18
19
20
21
22
# Setup: Add file and commit           #
########################################
write_file datafile "data"
write_file commitmsg "committed"

fossil add datafile
fossil commit -m "c1"


if {![regexp {^New_Version: ([0-9a-f]{40})$} $RESULT m UUID]} {
  test amend-setup-failure false
  return
}

########################################
# Test: -branch                        #







>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Setup: Add file and commit           #
########################################
write_file datafile "data"
write_file commitmsg "committed"

fossil add datafile
fossil commit -m "c1"
write_file datafile "data.file"
fossil commit -m "c2"
if {![regexp {^New_Version: ([0-9a-f]{40})$} $RESULT m UUID]} {
  test amend-setup-failure false
  return
}

########################################
# Test: -branch                        #
125
126
127
128
129
130
131
132
133















































  "%d/%m/%Y"
}
set sc 0
foreach badformat $badformats {
  incr sc
  set datetime [clock format $timestamp -format $badformat -gmt 1]
  fossil amend $UUID -date $datetime
  test amend-date-2.$sc {[string first "Unsupported date format, use YYYY-MM-DD HH:MM:SS" $RESULT] != -1}
}






















































|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
  "%d/%m/%Y"
}
set sc 0
foreach badformat $badformats {
  incr sc
  set datetime [clock format $timestamp -format $badformat -gmt 1]
  fossil amend $UUID -date $datetime
  test amend-date-2.$sc {[string first "YYYY-MM-DD HH:MM:SS" $RESULT] != -1}
}

########################################
# Test: -hide                          #
########################################
fossil amend $UUID -hide
test amend-hide-1.1 {[string match "*uuid:*$UUID*" $RESULT]}
fossil tag ls --raw $UUID
test amend-hide-1.2 {[string first "hidden" $RESULT] != -1}
fossil timeline -n 1
test amend-hide-1.3 {[string match {*Add*propagating*"hidden".*} $RESULT]}

########################################
# Test: -close                          #
########################################
fossil amend $UUID -close
test amend-close-1.1 {[string match "*uuid:*$UUID*" $RESULT]}
fossil tag ls --raw $UUID
test amend-close-1.2 {[string first "closed" $RESULT] != -1}
fossil timeline -n 1
test amend-close-1.3 {[string match {*Marked*"Closed".*} $RESULT]}
write_file datafile "changed"
fossil commit -m "should fail"
test amend-close-2 {[string first "closed leaf" $RESULT] != -1}

fossil revert
fossil update trunk
write_file datafile "cb"
fossil commit -m "closed-branch" --branch "closebranch"
if {![regexp {^New_Version: ([0-9a-f]{40})$} $RESULT m UUID3]} {
  test amend-close-3.all false
} else {
  write_file datafile "b1"
  fossil commit -m "m1"
  write_file datafile "b2"
  fossil commit -m "m2"
  fossil amend $UUID3 --close
  test amend-close-3.1 {[string match "*uuid:*$UUID3*" $RESULT]}
  fossil tag ls --raw current
  test amend-close-3.2 {[string first "closed" $RESULT] != -1}
  fossil timeline -n 1
  test amend-close-3.3 {
    [string match "*Add*propagating*\"closed\".*" $RESULT]
  }
  write_file datafile "changed"
  fossil commit -m "should fail"
  test amend-close-3.4 {[string first "closed leaf" $RESULT] != -1}
}