comparison hgext/largefiles/lfutil.py @ 48169:1e98f9b5bc71

largefiles: add tr backup for largefilesdirstate This will help us in automatically restoring the largefilesdirstate if a transaction is rolled back. Differential Revision: https://phab.mercurial-scm.org/D11611
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 19 Jul 2021 04:12:14 +0530
parents df3021c1f093
children 991e6f728b50
comparison
equal deleted inserted replaced
48168:df3021c1f093 48169:1e98f9b5bc71
193 193
194 def write(self, tr): 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 if tr:
199 tr.addbackup(b'largefiles/dirstate', location=b'plain')
198 super(largefilesdirstate, self).write(None) 200 super(largefilesdirstate, self).write(None)
199 201
200 202
201 def openlfdirstate(ui, repo, create=True): 203 def openlfdirstate(ui, repo, create=True):
202 """ 204 """