##// END OF EJS Templates
largefiles: pay attention to dropped standin files when updating largefiles...
Matt Harbison -
r35175:b175e54c stable
parent child Browse files
Show More
@@ -455,6 +455,7 b' def updatelfiles(ui, repo, filelist=None'
455 lfiles = [f for f in lfiles if f in filelist]
455 lfiles = [f for f in lfiles if f in filelist]
456
456
457 update = {}
457 update = {}
458 dropped = set()
458 updated, removed = 0, 0
459 updated, removed = 0, 0
459 wvfs = repo.wvfs
460 wvfs = repo.wvfs
460 wctx = repo[None]
461 wctx = repo[None]
@@ -476,7 +477,11 b' def updatelfiles(ui, repo, filelist=None'
476 expecthash = lfutil.readasstandin(wctx[relstandin])
477 expecthash = lfutil.readasstandin(wctx[relstandin])
477 if expecthash != '':
478 if expecthash != '':
478 if lfile not in wctx: # not switched to normal file
479 if lfile not in wctx: # not switched to normal file
479 wvfs.unlinkpath(rellfile, ignoremissing=True)
480 if repo.dirstate[relstandin] != '?':
481 wvfs.unlinkpath(rellfile, ignoremissing=True)
482 else:
483 dropped.add(rellfile)
484
480 # use normallookup() to allocate an entry in largefiles
485 # use normallookup() to allocate an entry in largefiles
481 # dirstate to prevent lfilesrepo.status() from reporting
486 # dirstate to prevent lfilesrepo.status() from reporting
482 # missing files as removed.
487 # missing files as removed.
@@ -496,6 +501,15 b' def updatelfiles(ui, repo, filelist=None'
496 lfdirstate.write()
501 lfdirstate.write()
497
502
498 if lfiles:
503 if lfiles:
504 lfiles = [f for f in lfiles if f not in dropped]
505
506 for f in dropped:
507 repo.wvfs.unlinkpath(lfutil.standin(f))
508
509 # This needs to happen for dropped files, otherwise they stay in
510 # the M state.
511 lfutil.synclfdirstate(repo, lfdirstate, f, normallookup)
512
499 statuswriter(_('getting changed largefiles\n'))
513 statuswriter(_('getting changed largefiles\n'))
500 cachelfiles(ui, repo, None, lfiles)
514 cachelfiles(ui, repo, None, lfiles)
501
515
@@ -1148,20 +1148,18 b' Move (and then undo) a directory move wi'
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/
@@ -1173,13 +1171,13 b' BUG: the standin for subdir2 should be d'
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
@@ -1189,13 +1187,10 b' existing under .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
@@ -1236,9 +1231,6 b' Start from scratch, and rename something'
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/
General Comments 0
You need to be logged in to leave comments. Login now