dirstate: make writing in-memory changes aware of transaction activity
This patch delays writing in-memory changes out, if transaction is
running.
'_getfsnow()' is defined as a function, to hook it easily for
ambiguous timestamp tests (see also fakedirstatewritetime.py)
'if tr:' code path in this patch is still disabled at this revision,
because there is no client invoking 'dirstate.write()' with repo
object.
BTW, this patch changes 'dirstate.invalidate()' semantics around
'dirstate.write()' in a transaction scope:
before:
with repo.transaction():
dirstate.CHANGE('A')
dirstate.write() # change for A is written out here
dirstate.CHANGE('B')
dirstate.invalidate() # discards only change for B
after:
with repo.transaction():
dirstate.CHANGE('A')
dirstate.write() # change for A is still kept in memory
dirstate.CHANGE('B')
dirstate.invalidate() # discards changes for A and B
Fortunately, there is no code path expecting the former, at least, in
Mercurial itself, because 'dirstateguard' was introduced to remove
such 'dirstate.invalidate()'.
syntax: glob
*.elc
*.tmp
*.orig
*.rej
*~
*.mergebackup
*.o
*.so
*.dll
*.exe
*.pyd
*.pyc
*.pyo
*$py.class
*.swp
*.prof
*.zip
\#*\#
.\#*
tests/.coverage*
tests/annotated
tests/*.err
tests/htmlcov
build
contrib/hgsh/hgsh
contrib/vagrant/.vagrant
dist
packages
doc/common.txt
doc/*.[0-9]
doc/*.[0-9].txt
doc/*.[0-9].gendoc.txt
doc/*.[0-9].{x,ht}ml
MANIFEST
MANIFEST.in
patches
mercurial/__version__.py
mercurial/hgpythonlib.h
mercurial.egg-info
.DS_Store
tags
cscope.*
.idea/*
i18n/hg.pot
locale/*/LC_MESSAGES/hg.mo
hgext/__index__.py
# files installed with a local --pure build
mercurial/base85.py
mercurial/bdiff.py
mercurial/diffhelpers.py
mercurial/mpatch.py
mercurial/osutil.py
mercurial/parsers.py
syntax: regexp
^\.pc/
^\.(pydev)?project
# hackable windows distribution additions
^hg-python
^hg.py$