Mercurial > hg
comparison mercurial/store.py @ 40748:df8ed31a8ad8
store: write fncache only once if there are both adds and removes
Differential Revision: https://phab.mercurial-scm.org/D5307
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Tue, 27 Nov 2018 16:16:13 +0300 |
parents | 0728d87a8631 |
children | 6498f0e03526 |
comparison
equal
deleted
inserted
replaced
40747:380a1f73830f | 40748:df8ed31a8ad8 |
---|---|
473 fp.close() | 473 fp.close() |
474 | 474 |
475 def write(self, tr): | 475 def write(self, tr): |
476 if self._dirty: | 476 if self._dirty: |
477 assert self.entries is not None | 477 assert self.entries is not None |
478 self.entries = self.entries | self.addls | |
479 self.addls = set() | |
478 tr.addbackup('fncache') | 480 tr.addbackup('fncache') |
479 fp = self.vfs('fncache', mode='wb', atomictemp=True) | 481 fp = self.vfs('fncache', mode='wb', atomictemp=True) |
480 if self.entries: | 482 if self.entries: |
481 fp.write(encodedir('\n'.join(self.entries) + '\n')) | 483 fp.write(encodedir('\n'.join(self.entries) + '\n')) |
482 fp.close() | 484 fp.close() |