Mercurial > hg
comparison hgext/largefiles/lfutil.py @ 48168:df3021c1f093
largefiles: pass current transaction to `lfdirstate.write()`
Right now, the largefile dirstate is not included in transaction which makes
things complex. Next patch will add code to do so, so let's make it mandatory to
pass current transaction and pass from all existing callers.
Differential Revision: https://phab.mercurial-scm.org/D11610
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 19 Jul 2021 04:11:08 +0530 |
parents | 6f54afb094bd |
children | 1e98f9b5bc71 |
comparison
equal
deleted
inserted
replaced
48167:1b0f8aafedea | 48168:df3021c1f093 |
---|---|
189 return super(largefilesdirstate, self).normallookup(unixpath(f)) | 189 return super(largefilesdirstate, self).normallookup(unixpath(f)) |
190 | 190 |
191 def _ignore(self, f): | 191 def _ignore(self, f): |
192 return False | 192 return False |
193 | 193 |
194 def write(self, tr=False): | 194 def write(self, tr): |
195 # (1) disable PENDING mode always | 195 # (1) disable PENDING mode always |
196 # (lfdirstate isn't yet managed as a part of the transaction) | 196 # (lfdirstate isn't yet managed as a part of the transaction) |
197 # (2) avoid develwarn 'use dirstate.write with ....' | 197 # (2) avoid develwarn 'use dirstate.write with ....' |
198 super(largefilesdirstate, self).write(None) | 198 super(largefilesdirstate, self).write(None) |
199 | 199 |
586 | 586 |
587 for f in ctx.files(): | 587 for f in ctx.files(): |
588 lfile = splitstandin(f) | 588 lfile = splitstandin(f) |
589 if lfile is not None: | 589 if lfile is not None: |
590 synclfdirstate(repo, lfdirstate, lfile, False) | 590 synclfdirstate(repo, lfdirstate, lfile, False) |
591 lfdirstate.write() | 591 lfdirstate.write(repo.currenttransaction()) |
592 | 592 |
593 # As part of committing, copy all of the largefiles into the cache. | 593 # As part of committing, copy all of the largefiles into the cache. |
594 # | 594 # |
595 # Using "node" instead of "ctx" implies additional "repo[node]" | 595 # Using "node" instead of "ctx" implies additional "repo[node]" |
596 # lookup while copyalltostore(), but can omit redundant check for | 596 # lookup while copyalltostore(), but can omit redundant check for |