Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 26748:5ba0a99ff27f
dirstate: make dirstate.write() callers pass transaction object to it
Now, 'dirstate.write(tr)' delays writing in-memory changes out, if a
transaction is running.
This may cause treating this revision as "the first bad one" at
bisecting in some cases using external hook process inside transaction
scope, because some external hooks and editor process are still
invoked without HG_PENDING and pending changes aren't visible to them.
'dirstate.write()' callers below in localrepo.py explicitly use 'None'
as 'tr', because they can assume that no transaction is running:
- just before starting transaction
- at closing transaction, or
- at unlocking wlock
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 17 Oct 2015 01:15:34 +0900 |
parents | a3fcc8e3136b |
children | bd19561b98d9 |
comparison
equal
deleted
inserted
replaced
26747:beff0b2481b3 | 26748:5ba0a99ff27f |
---|---|
1322 self._repo.dirstate.endparentchange() | 1322 self._repo.dirstate.endparentchange() |
1323 | 1323 |
1324 # write changes out explicitly, because nesting wlock at | 1324 # write changes out explicitly, because nesting wlock at |
1325 # runtime may prevent 'wlock.release()' in 'repo.commit()' | 1325 # runtime may prevent 'wlock.release()' in 'repo.commit()' |
1326 # from immediately doing so for subsequent changing files | 1326 # from immediately doing so for subsequent changing files |
1327 self._repo.dirstate.write() | 1327 self._repo.dirstate.write(self._repo.currenttransaction()) |
1328 | 1328 |
1329 class workingctx(committablectx): | 1329 class workingctx(committablectx): |
1330 """A workingctx object makes access to data related to | 1330 """A workingctx object makes access to data related to |
1331 the current working directory convenient. | 1331 the current working directory convenient. |
1332 date - any valid date string or (unixtime, offset), or None. | 1332 date - any valid date string or (unixtime, offset), or None. |
1528 for f in fixup: | 1528 for f in fixup: |
1529 normal(f) | 1529 normal(f) |
1530 # write changes out explicitly, because nesting | 1530 # write changes out explicitly, because nesting |
1531 # wlock at runtime may prevent 'wlock.release()' | 1531 # wlock at runtime may prevent 'wlock.release()' |
1532 # below from doing so for subsequent changing files | 1532 # below from doing so for subsequent changing files |
1533 self._repo.dirstate.write() | 1533 self._repo.dirstate.write(self._repo.currenttransaction()) |
1534 finally: | 1534 finally: |
1535 wlock.release() | 1535 wlock.release() |
1536 except error.LockError: | 1536 except error.LockError: |
1537 pass | 1537 pass |
1538 return modified, fixup | 1538 return modified, fixup |