Show More
@@ -209,9 +209,6 b' def _aborttransaction(repo):' | |||
|
209 | 209 | tr = repo.currenttransaction() |
|
210 | 210 | tr.abort() |
|
211 | 211 | |
|
212 | # TODO: this should be done via transaction.abort() | |
|
213 | repo.dirstate.invalidate() # prevent wlock from writing changes out | |
|
214 | ||
|
215 | 212 | # restore to backuped dirstate |
|
216 | 213 | repo.vfs.rename(dirstatebackup, 'dirstate') |
|
217 | 214 | dirstatebackup = None |
@@ -997,13 +997,26 b' class localrepository(object):' | |||
|
997 | 997 | pending = lambda: tr.writepending() and self.root or "" |
|
998 | 998 | reporef().hook('pretxnclose', throw=True, pending=pending, |
|
999 | 999 | txnname=desc, **tr.hookargs) |
|
1000 | def releasefn(tr, success): | |
|
1001 | repo = reporef() | |
|
1002 | if success: | |
|
1003 | repo.dirstate.write() | |
|
1004 | else: | |
|
1005 | # prevent in-memory changes from being written out at | |
|
1006 | # the end of outer wlock scope or so | |
|
1007 | repo.dirstate.invalidate() | |
|
1008 | ||
|
1009 | # discard all changes (including ones already written | |
|
1010 | # out) in this transaction | |
|
1011 | repo.vfs.rename('journal.dirstate', 'dirstate') | |
|
1000 | 1012 | |
|
1001 | 1013 | tr = transaction.transaction(rp, self.svfs, vfsmap, |
|
1002 | 1014 | "journal", |
|
1003 | 1015 | "undo", |
|
1004 | 1016 | aftertrans(renames), |
|
1005 | 1017 | self.store.createmode, |
|
1006 |
validator=validate |
|
|
1018 | validator=validate, | |
|
1019 | releasefn=releasefn) | |
|
1007 | 1020 | |
|
1008 | 1021 | tr.hookargs['txnid'] = txnid |
|
1009 | 1022 | # note: writing the fncache only during finalize mean that the file is |
General Comments 0
You need to be logged in to leave comments.
Login now