Tue, 18 Sep 2018 18:21:47 -0700 filelog: stop proxying datafile (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 18:21:47 -0700] rev 39782
filelog: stop proxying datafile (API) It appears the censor code was the last user of this proxy. With there being a dedicated censor API, we can drop the proxy. Differential Revision: https://phab.mercurial-scm.org/D4660
Tue, 18 Sep 2018 18:03:41 -0700 filelog: stop proxying _addrevision() (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 18:03:41 -0700] rev 39781
filelog: stop proxying _addrevision() (API) There are no callers of this API in core. And I'm not sure why this proxy was added in the first place, as the commit that added it (1541e1a8e87d) didn't appear to have any callers in the repo either. Who knows. Differential Revision: https://phab.mercurial-scm.org/D4659
Tue, 18 Sep 2018 17:57:36 -0700 filelog: stop proxying compress() (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 17:57:36 -0700] rev 39780
filelog: stop proxying compress() (API) The censoring code was previously relying on this. With a dedicated censoring API on the interface, no consumers are left and we can stop proxying this method. Differential Revision: https://phab.mercurial-scm.org/D4658
Tue, 18 Sep 2018 17:56:15 -0700 filelog: stop proxying start(), end(), and length() (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 17:56:15 -0700] rev 39779
filelog: stop proxying start(), end(), and length() (API) These were needed by the censoring code, which formerly lived in the censor extension. Now that there is a censoring API on the file storage interface, nothing uses these methods and we can stop proxying them. Differential Revision: https://phab.mercurial-scm.org/D4657
Tue, 18 Sep 2018 17:51:43 -0700 revlog: move censor logic out of censor extension
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 17:51:43 -0700] rev 39778
revlog: move censor logic out of censor extension The censor extension is doing very low-level things with revlogs. It is fundamentally impossible for this logic to remain in the censor extension while support multiple storage backends: we need each storage backend to implement censor in its own storage-specific way. This commit effectively moves the revlog-specific censoring code to be a method of revlogs themselves. We've defined a new API on the file storage interface for censoring an individual node. Even though the current censoring code doesn't use it, the API requires a transaction instance because it logically makes sense for storage backends to require an active transaction (which implies a held write lock) in order to rewrite storage. After this commit, the censor extension has been reduced to boilerplate precondition checking before invoking the generic storage API. I tried to keep the code as similar as possible. But some minor changes were made: * We use self._io instead of instantiating a new revlogio instance. * We compare self.version against REVLOGV0 instead of != REVLOGV1 because presumably all future revlog versions will support censoring. * We use self.opener instead of going through repo.svfs (we don't have a handle on the repo instance from a revlog). * "revlog" dropped * Replace "flog" with "self". Differential Revision: https://phab.mercurial-scm.org/D4656
Tue, 18 Sep 2018 16:47:09 -0700 global: replace most uses of RevlogError with StorageError (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 16:47:09 -0700] rev 39777
global: replace most uses of RevlogError with StorageError (API) When catching errors in storage, we should be catching StorageError instead of RevlogError. When throwing errors related to storage, we shouldn't be using RevlogError unless we know the error stemmed from revlogs. And we only reliably know that if we're in revlog.py or are inheriting from a type defined in revlog.py. Differential Revision: https://phab.mercurial-scm.org/D4655
Tue, 18 Sep 2018 16:45:13 -0700 error: introduce StorageError
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 16:45:13 -0700] rev 39776
error: introduce StorageError Errors in revlogs are often represented by RevlogError. It's fine for revlogs to raise a revlog-specific exception. But in the context of multiple storage backends, it doesn't make sense to be throwing or catching an exception with "revlog" in its name when revlogs may not even be in play. This commit introduces a new generic StorageError type for representing errors in the storage layer. RevlogError is an instance of this type. Interface documentation and tests referencing RevlogError has been updated to specify StorageError should be used. .. api:: ``error.StorageError`` has been introduced to represent errors in storage. It should be used in place of ``error.RevlogError`` unless the error is known to come from a revlog. Differential Revision: https://phab.mercurial-scm.org/D4654
Tue, 18 Sep 2018 16:28:17 -0700 revlog: drop LookupError alias (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 16:28:17 -0700] rev 39775
revlog: drop LookupError alias (API) This alias is especially bad because it shadows the built-in LookupError type. This has caused me confusion in the past when reading revlog code. Qualifying all uses with "error." will make it obvious that we're using a Mercurial error type. Differential Revision: https://phab.mercurial-scm.org/D4653
Tue, 18 Sep 2018 16:24:36 -0700 revlog: drop some more error aliases (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 16:24:36 -0700] rev 39774
revlog: drop some more error aliases (API) These should be lightly used and I doubt that will be any strong objections to removing the aliases. Note that some uses of ProgrammingError in this file use translated messages. I'm pretty sure that's a bug. But the linters don't complain, so meh. Differential Revision: https://phab.mercurial-scm.org/D4652
Tue, 18 Sep 2018 16:18:37 -0700 revlog: drop RevlogError alias (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 18 Sep 2018 16:18:37 -0700] rev 39773
revlog: drop RevlogError alias (API) error.RevlogError was moved from revlog.py in 08cabecfa8a8 in 2009. revlog.RevlogError has remained as an alias ever since. Let's drop the alias and use error.RevlogError directly. Differential Revision: https://phab.mercurial-scm.org/D4651
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip