# HG changeset patch # User Mads Kiilerich # Date 1420033562 -3600 # Node ID 997a96cf63443db2f8d4682d25d367e9344b2cdb # Parent 97eb62b0f4a91cea78909e7098c6b069c3899f89 largefiles: mark lfile as added in lfdirstate when the standin is added This is an alternative solution to the problem addressed by f72d73937853. This implementation has the advantage that it doesn't mark clean largefiles as normallookup. We can thus avoid repeated rehashing of all largefiles when f72d73937853 is backed out. This implementation use the existing 'lfmr' actions that 23fe278bde43 introduced for handling another part of the same cases. diff -r 97eb62b0f4a9 -r 997a96cf6344 hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Wed Dec 31 14:45:02 2014 +0100 +++ b/hgext/largefiles/overrides.py Wed Dec 31 14:46:02 2014 +0100 @@ -445,7 +445,7 @@ removes = set(a[0] for a in actions['r']) newglist = [] - lfmr = [] # LargeFiles: Mark as Removed + lfmr = [] # LargeFiles: Mark as Removed ... and mark largefile as added for action in actions['g']: f, args, msg = action splitstandin = f and lfutil.splitstandin(f) @@ -514,10 +514,14 @@ def mergerecordupdates(orig, repo, actions, branchmerge): if 'lfmr' in actions: - # this should be executed before 'orig', to execute 'remove' - # before all other actions + lfdirstate = lfutil.openlfdirstate(repo.ui, repo) for lfile, args, msg in actions['lfmr']: + # this should be executed before 'orig', to execute 'remove' + # before all other actions repo.dirstate.remove(lfile) + # make sure lfile doesn't get synclfdirstate'd as normal + lfdirstate.add(lfile) + lfdirstate.write() return orig(repo, actions, branchmerge)