##// END OF EJS Templates
largefiles: pass current transaction to `lfdirstate.write()`...
Pulkit Goyal -
r48982:df3021c1 default
parent child Browse files
Show More
@@ -569,7 +569,7 b' def updatelfiles('
569 removed += 1
569 removed += 1
570
570
571 # largefile processing might be slow and be interrupted - be prepared
571 # largefile processing might be slow and be interrupted - be prepared
572 lfdirstate.write()
572 lfdirstate.write(repo.currenttransaction())
573
573
574 if lfiles:
574 if lfiles:
575 lfiles = [f for f in lfiles if f not in dropped]
575 lfiles = [f for f in lfiles if f not in dropped]
@@ -619,7 +619,7 b' def updatelfiles('
619
619
620 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
620 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
621
621
622 lfdirstate.write()
622 lfdirstate.write(repo.currenttransaction())
623 if lfiles:
623 if lfiles:
624 statuswriter(
624 statuswriter(
625 _(b'%d largefiles updated, %d removed\n') % (updated, removed)
625 _(b'%d largefiles updated, %d removed\n') % (updated, removed)
@@ -191,7 +191,7 b' class largefilesdirstate(dirstate.dirsta'
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 ....'
@@ -588,7 +588,7 b' def markcommitted(orig, ctx, node):'
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 #
@@ -151,7 +151,7 b' def addlargefiles(ui, repo, isaddremove,'
151 )
151 )
152 standins.append(standinname)
152 standins.append(standinname)
153 lfdirstate.set_tracked(f)
153 lfdirstate.set_tracked(f)
154 lfdirstate.write()
154 lfdirstate.write(repo.currenttransaction())
155 bad += [
155 bad += [
156 lfutil.splitstandin(f)
156 lfutil.splitstandin(f)
157 for f in repo[None].add(standins)
157 for f in repo[None].add(standins)
@@ -229,7 +229,7 b' def removelargefiles(ui, repo, isaddremo'
229 for f in remove:
229 for f in remove:
230 lfdirstate.set_untracked(lfutil.splitstandin(f))
230 lfdirstate.set_untracked(lfutil.splitstandin(f))
231
231
232 lfdirstate.write()
232 lfdirstate.write(repo.currenttransaction())
233
233
234 return result
234 return result
235
235
@@ -659,7 +659,7 b' def mergerecordupdates(orig, repo, actio'
659 )
659 )
660 # make sure lfile doesn't get synclfdirstate'd as normal
660 # make sure lfile doesn't get synclfdirstate'd as normal
661 lfdirstate.update_file(lfile, p1_tracked=False, wc_tracked=True)
661 lfdirstate.update_file(lfile, p1_tracked=False, wc_tracked=True)
662 lfdirstate.write()
662 lfdirstate.write(repo.currenttransaction())
663
663
664 return orig(repo, actions, branchmerge, getfiledata)
664 return orig(repo, actions, branchmerge, getfiledata)
665
665
@@ -864,7 +864,7 b' def overridecopy(orig, ui, repo, pats, o'
864 util.copyfile(repo.wjoin(srclfile), repo.wjoin(destlfile))
864 util.copyfile(repo.wjoin(srclfile), repo.wjoin(destlfile))
865
865
866 lfdirstate.set_tracked(destlfile)
866 lfdirstate.set_tracked(destlfile)
867 lfdirstate.write()
867 lfdirstate.write(repo.currenttransaction())
868 except error.Abort as e:
868 except error.Abort as e:
869 if e.message != _(b'no files to copy'):
869 if e.message != _(b'no files to copy'):
870 raise e
870 raise e
@@ -896,7 +896,7 b' def overriderevert(orig, ui, repo, ctx, '
896 with repo.wlock():
896 with repo.wlock():
897 lfdirstate = lfutil.openlfdirstate(ui, repo)
897 lfdirstate = lfutil.openlfdirstate(ui, repo)
898 s = lfutil.lfdirstatestatus(lfdirstate, repo)
898 s = lfutil.lfdirstatestatus(lfdirstate, repo)
899 lfdirstate.write()
899 lfdirstate.write(repo.currenttransaction())
900 for lfile in s.modified:
900 for lfile in s.modified:
901 lfutil.updatestandin(repo, lfile, lfutil.standin(lfile))
901 lfutil.updatestandin(repo, lfile, lfutil.standin(lfile))
902 for lfile in s.deleted:
902 for lfile in s.deleted:
@@ -1383,7 +1383,7 b' def cmdutilforget('
1383 lfdirstate = lfutil.openlfdirstate(ui, repo)
1383 lfdirstate = lfutil.openlfdirstate(ui, repo)
1384 for f in forget:
1384 for f in forget:
1385 lfdirstate.set_untracked(f)
1385 lfdirstate.set_untracked(f)
1386 lfdirstate.write()
1386 lfdirstate.write(repo.currenttransaction())
1387 standins = [lfutil.standin(f) for f in forget]
1387 standins = [lfutil.standin(f) for f in forget]
1388 for f in standins:
1388 for f in standins:
1389 repo.wvfs.unlinkpath(f, ignoremissing=True)
1389 repo.wvfs.unlinkpath(f, ignoremissing=True)
@@ -1792,7 +1792,7 b' def mergeupdate(orig, repo, node, branch'
1792 # interrupted before largefiles and lfdirstate are synchronized
1792 # interrupted before largefiles and lfdirstate are synchronized
1793 for lfile in oldclean:
1793 for lfile in oldclean:
1794 lfdirstate.set_possibly_dirty(lfile)
1794 lfdirstate.set_possibly_dirty(lfile)
1795 lfdirstate.write()
1795 lfdirstate.write(repo.currenttransaction())
1796
1796
1797 oldstandins = lfutil.getstandinsstate(repo)
1797 oldstandins = lfutil.getstandinsstate(repo)
1798 wc = kwargs.get('wc')
1798 wc = kwargs.get('wc')
@@ -1812,7 +1812,7 b' def mergeupdate(orig, repo, node, branch'
1812 # all the ones that didn't change as clean
1812 # all the ones that didn't change as clean
1813 for lfile in oldclean.difference(filelist):
1813 for lfile in oldclean.difference(filelist):
1814 lfdirstate.update_file(lfile, p1_tracked=True, wc_tracked=True)
1814 lfdirstate.update_file(lfile, p1_tracked=True, wc_tracked=True)
1815 lfdirstate.write()
1815 lfdirstate.write(repo.currenttransaction())
1816
1816
1817 if branchmerge or force or partial:
1817 if branchmerge or force or partial:
1818 filelist.extend(s.deleted + s.removed)
1818 filelist.extend(s.deleted + s.removed)
@@ -310,7 +310,7 b' def reposetup(ui, repo):'
310 ]
310 ]
311
311
312 if gotlock:
312 if gotlock:
313 lfdirstate.write()
313 lfdirstate.write(self.currenttransaction())
314
314
315 self.lfstatus = True
315 self.lfstatus = True
316 return scmutil.status(*result)
316 return scmutil.status(*result)
General Comments 0
You need to be logged in to leave comments. Login now