Mercurial > hg
diff mercurial/dirstate.py @ 48393:1a8a70b4b0ad
dirstate: cleanup remaining of "now" during write
Since the whole `need_delay` have been removed, we no longer need this.
Differential Revision: https://phab.mercurial-scm.org/D11797
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 19 Nov 2021 03:03:01 +0100 |
parents | 434de12918fd |
children | c6d00759dc2b |
line wrap: on
line diff
--- a/mercurial/dirstate.py Fri Nov 19 03:04:42 2021 +0100 +++ b/mercurial/dirstate.py Fri Nov 19 03:03:01 2021 +0100 @@ -733,20 +733,11 @@ filename = self._filename if tr: - # 'dirstate.write()' is not only for writing in-memory - # changes out, but also for dropping ambiguous timestamp. - # delayed writing re-raise "ambiguous timestamp issue". - # See also the wiki page below for detail: - # https://www.mercurial-scm.org/wiki/DirstateTransactionPlan - - # record when mtime start to be ambiguous - now = timestamp.get_fs_now(self._opener) - # delay writing in-memory changes out tr.addfilegenerator( b'dirstate', (self._filename,), - lambda f: self._writedirstate(tr, f, now=now), + lambda f: self._writedirstate(tr, f), location=b'plain', ) return @@ -765,7 +756,7 @@ """ self._plchangecallbacks[category] = callback - def _writedirstate(self, tr, st, now=None): + def _writedirstate(self, tr, st): # notify callbacks about parents change if self._origpl is not None and self._origpl != self._pl: for c, callback in sorted( @@ -774,12 +765,7 @@ callback(self, self._origpl, self._pl) self._origpl = None - if now is None: - # use the modification time of the newly created temporary file as the - # filesystem's notion of 'now' - now = timestamp.mtime_of(util.fstat(st)) - - self._map.write(tr, st, now) + self._map.write(tr, st) self._dirty = False def _dirignore(self, f):