comparison tests/test-largefiles-misc.t @ 35168:b175e54c1103 stable

largefiles: pay attention to dropped standin files when updating largefiles Previously, the largefile for a dropped standin would be deleted here, and then restored from the cache. This had the effect of clobbering uncommitted changes if a revert caused the file to be forgotten, which is not what happens with a normal file. Now the removal and update is skipped for dropped largefiles, and the corresponding standin is deleted from disk. This was noticed when working on issue5738 because the forgotten standin files were left behind, and that changes the behavior of the next rename to that directory. My first attempt was to cleanup the standins before calling this. That failed, because this function deletes the largefile if the corresponding standin is missing. This function is called by the revert command, merge (and therefore update), and patch, via the scmutil.marktouched() override. So it should be pretty narrow in scope. I didn't mark issue5738 as fixed because the move related issues can still happen if the main tree and the .hglf subtree get out of sync somehow. I don't see an easy fix for that, but that should be an edge case. If whoever queues this thinks it is good enough to close out the bug and can cram it into the summary, go for it.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 12 Nov 2017 23:45:14 -0500
parents 9fb2b0b41bec
children aa905f9cdcda
comparison
equal deleted inserted replaced
35167:9fb2b0b41bec 35168:b175e54c1103
1146 1146
1147 $ hg status -C 1147 $ hg status -C
1148 ? dir/subdir2/large.bin 1148 ? dir/subdir2/large.bin
1149 ? large.orig 1149 ? large.orig
1150 1150
1151 BUG: The content of the forgotten file shouldn't be clobbered 1151 The content of the forgotten file shouldn't be clobbered
1152 1152
1153 $ cat dir/subdir2/large.bin 1153 $ cat dir/subdir2/large.bin
1154 large2 1154 modified
1155 1155
1156 BUG: the standin for subdir2 should be deleted, not just dropped 1156 The standin for subdir2 should be deleted, not just dropped
1157 1157
1158 $ listtree .hglf dir* large* 1158 $ listtree .hglf dir* large*
1159 .hglf/ 1159 .hglf/
1160 .hglf/dir/ 1160 .hglf/dir/
1161 .hglf/dir/subdir/ 1161 .hglf/dir/subdir/
1162 .hglf/dir/subdir/large.bin 1162 .hglf/dir/subdir/large.bin
1163 .hglf/dir/subdir2/
1164 .hglf/dir/subdir2/large.bin
1165 .hglf/large 1163 .hglf/large
1166 dir/ 1164 dir/
1167 dir/subdir/ 1165 dir/subdir/
1168 dir/subdir/large.bin 1166 dir/subdir/large.bin
1169 dir/subdir2/ 1167 dir/subdir2/
1171 large 1169 large
1172 large.orig 1170 large.orig
1173 1171
1174 $ rm -r dir/subdir2 1172 $ rm -r dir/subdir2
1175 1173
1176 BUG: subdir should not be in the destination. This is caused by the directory 1174 'subdir' should not be in the destination. It would be if the subdir2 directory
1177 existing under .hglf/. 1175 existed under .hglf/.
1178 $ hg mv dir/subdir dir/subdir2 1176 $ hg mv dir/subdir dir/subdir2
1179 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/subdir/large.bin (glob) 1177 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin (glob)
1180 1178
1181 $ hg status -C 1179 $ hg status -C
1182 A dir/subdir2/subdir/large.bin 1180 A dir/subdir2/large.bin
1183 dir/subdir/large.bin 1181 dir/subdir/large.bin
1184 R dir/subdir/large.bin 1182 R dir/subdir/large.bin
1185 ? large.orig 1183 ? large.orig
1186 1184
1187 $ listtree .hglf dir* large* 1185 $ listtree .hglf dir* large*
1188 .hglf/ 1186 .hglf/
1189 .hglf/dir/ 1187 .hglf/dir/
1190 .hglf/dir/subdir2/ 1188 .hglf/dir/subdir2/
1191 .hglf/dir/subdir2/large.bin 1189 .hglf/dir/subdir2/large.bin
1192 .hglf/dir/subdir2/subdir/
1193 .hglf/dir/subdir2/subdir/large.bin
1194 .hglf/large 1190 .hglf/large
1195 dir/ 1191 dir/
1196 dir/subdir2/ 1192 dir/subdir2/
1197 dir/subdir2/subdir/ 1193 dir/subdir2/large.bin
1198 dir/subdir2/subdir/large.bin
1199 large 1194 large
1200 large.orig 1195 large.orig
1201 1196
1202 Start from scratch, and rename something other than the final path component. 1197 Start from scratch, and rename something other than the final path component.
1203 1198
1234 $ listtree .hglf dir* large* 1229 $ listtree .hglf dir* large*
1235 .hglf/ 1230 .hglf/
1236 .hglf/dir/ 1231 .hglf/dir/
1237 .hglf/dir/subdir/ 1232 .hglf/dir/subdir/
1238 .hglf/dir/subdir/large.bin 1233 .hglf/dir/subdir/large.bin
1239 .hglf/dir2/
1240 .hglf/dir2/subdir/
1241 .hglf/dir2/subdir/large.bin
1242 .hglf/large 1234 .hglf/large
1243 dir/ 1235 dir/
1244 dir/subdir/ 1236 dir/subdir/
1245 dir/subdir/large.bin 1237 dir/subdir/large.bin
1246 dir2/ 1238 dir2/