Mercurial > hg
comparison mercurial/localrepo.py @ 25229:451df92cec49
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 20 May 2015 15:29:32 -0500 |
parents | bf6b476f3b36 2664f536a97e |
children | 5095059340dc |
comparison
equal
deleted
inserted
replaced
25228:63a57a2727b6 | 25229:451df92cec49 |
---|---|
972 reporef = weakref.ref(self) | 972 reporef = weakref.ref(self) |
973 def validate(tr): | 973 def validate(tr): |
974 """will run pre-closing hooks""" | 974 """will run pre-closing hooks""" |
975 pending = lambda: tr.writepending() and self.root or "" | 975 pending = lambda: tr.writepending() and self.root or "" |
976 reporef().hook('pretxnclose', throw=True, pending=pending, | 976 reporef().hook('pretxnclose', throw=True, pending=pending, |
977 xnname=desc, **tr.hookargs) | 977 txnname=desc, **tr.hookargs) |
978 | 978 |
979 tr = transaction.transaction(rp, self.sopener, vfsmap, | 979 tr = transaction.transaction(rp, self.sopener, vfsmap, |
980 "journal", | 980 "journal", |
981 "undo", | 981 "undo", |
982 aftertrans(renames), | 982 aftertrans(renames), |
983 self.store.createmode, | 983 self.store.createmode, |
984 validator=validate) | 984 validator=validate) |
985 | 985 |
986 trid = 'TXN:' + util.sha1("%s#%f" % (id(tr), time.time())).hexdigest() | 986 trid = 'TXN:' + util.sha1("%s#%f" % (id(tr), time.time())).hexdigest() |
987 tr.hookargs['TXNID'] = trid | 987 tr.hookargs['txnid'] = trid |
988 # note: writing the fncache only during finalize mean that the file is | 988 # note: writing the fncache only during finalize mean that the file is |
989 # outdated when running hooks. As fncache is used for streaming clone, | 989 # outdated when running hooks. As fncache is used for streaming clone, |
990 # this is not expected to break anything that happen during the hooks. | 990 # this is not expected to break anything that happen during the hooks. |
991 tr.addfinalize('flush-fncache', self.store.write) | 991 tr.addfinalize('flush-fncache', self.store.write) |
992 def txnclosehook(tr2): | 992 def txnclosehook(tr2): |