comparison mercurial/localrepo.py @ 33541:b47fef6d2365

transaction-summary: display the summary for all transactions Now that we records "all" changes happening in a transaction (in tr.changes) we will be able to provide better report on various changes (phases turned public, changeset obsoleted, branch merged or created, etc..) This is far too late in the cycle to play with this, but having this existing method called more widely will help extensions to play around with various options during the 4.4 cycle. Instead of calling registersummarycallback only for transactions we want, we always call it and use the transaction name to decide when to report (eg: we do not want `hg amend` to report new obsoleted changesets). Filtering on transaction name does not seems great, but seems good enough for the moment. We can change the API during the next cycle. The previous manual call during unbundling of the bundle2 "obsmarkers" part is no longer necessary and has been dropped.
author Boris Feld <boris.feld@octobus.net>
date Sun, 16 Jul 2017 02:20:06 +0200
parents 460733327640
children 22371eabb3b1
comparison
equal deleted inserted replaced
33540:e07c5740eaaa 33541:b47fef6d2365
1097 or self.ui.configbool('devel', 'check-locks')): 1097 or self.ui.configbool('devel', 'check-locks')):
1098 if self._currentlock(self._lockref) is None: 1098 if self._currentlock(self._lockref) is None:
1099 raise error.ProgrammingError('transaction requires locking') 1099 raise error.ProgrammingError('transaction requires locking')
1100 tr = self.currenttransaction() 1100 tr = self.currenttransaction()
1101 if tr is not None: 1101 if tr is not None:
1102 scmutil.registersummarycallback(self, tr, desc)
1102 return tr.nest() 1103 return tr.nest()
1103 1104
1104 # abort here if the journal already exists 1105 # abort here if the journal already exists
1105 if self.svfs.exists("journal"): 1106 if self.svfs.exists("journal"):
1106 raise error.RepoError( 1107 raise error.RepoError(
1253 tr.addabort('txnabort-hook', txnaborthook) 1254 tr.addabort('txnabort-hook', txnaborthook)
1254 # avoid eager cache invalidation. in-memory data should be identical 1255 # avoid eager cache invalidation. in-memory data should be identical
1255 # to stored data if transaction has no error. 1256 # to stored data if transaction has no error.
1256 tr.addpostclose('refresh-filecachestats', self._refreshfilecachestats) 1257 tr.addpostclose('refresh-filecachestats', self._refreshfilecachestats)
1257 self._transref = weakref.ref(tr) 1258 self._transref = weakref.ref(tr)
1259 scmutil.registersummarycallback(self, tr, desc)
1258 return tr 1260 return tr
1259 1261
1260 def _journalfiles(self): 1262 def _journalfiles(self):
1261 return ((self.svfs, 'journal'), 1263 return ((self.svfs, 'journal'),
1262 (self.vfs, 'journal.dirstate'), 1264 (self.vfs, 'journal.dirstate'),