Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add support for matching against unknown properties in dictHEADmasterSascha Silbe2018-01-041-2/+2
| | | | | | We are already indexing "unknown" (i.e. non-standard) properties so there's no reason not to support performing exact matches against them.
* Sugar v2 API: Fix updating entries containing version_id in metadataSascha Silbe2015-11-021-0/+1
| | | | | | | | | | | | | | A caller using the Sugar v2 D-Bus API is usually unaware of version support. When updating an entry, they might pass through all metadata unchanged, including version_id. When data got updated (not just metadata), this version_id property previously was passed through to InternalApi.save(). The latter uses any passed-in version_id property as the intended child id (e.g. for restoring from backups, or for allocating ids on the caller side). Since the version_id was that of the parent entry, InternalApi.save() bailed out with an error. Fix this by dropping any version_id property in DBusApiSugarV2.update() prior to calling InternalApi.save().
* Log all exceptions for D-Bus methodsSascha Silbe2015-11-021-0/+32
| | | | For easier debugging, log any exception we pass through to the caller.
* Reindex entry on new commit (metadata update)Sascha Silbe2014-05-242-17/+30
| | | | | | | | | | When re-indexing entries, take the git commit id into account so that we notice entries we already know about but where the metadata has changed. The first re-index run after an update will need to process all entries in order to add the commit_id value to the index. This may take a long time. This change is backwards compatible.
* Persist changed metadata in gitSascha Silbe2014-05-221-0/+14
| | | | | | | | | | | | | When only the metadata of an entry got changed, gdatastore only updated the Xapian index but neglected git. This caused the change not to persist across an index rebuild and not to propagate across gdatastore instances. We now store the updated metadata in a new commit with the same ref name and having the previous ref as parent. This should be enough for the index rebuild case. It will also propagate nicely through git, though we don't have code in place yet to notice updated entries (rather than completely new ones).
* Add support for additional, read-only data storesSascha Silbe2013-07-292-18/+84
| | | | | | | | | | | | | | | Some users may have direct access to additional data stores in gdatastore format. Allow the user to "register" them by placing links inside the (new) "extra-stores" directory and use them as additional sources. Modification is only supported for the primary store. The additional ones are used for reading only. In particular, trying to remove an entry that's contained in an extra store will yield an error (no shadowing). The extra stores will need to use exactly the same on-disk format as the primary one. No automatic migration is done.
* tests: Adapt to API changes (native API)Sascha Silbe2013-07-291-6/+6
| | | | | | Commit 23164d7f changed the native API to pass paths as byte strings so that non-UTF8 paths can be passed. Adjust the test cases accordingly.
* add FIXMESascha Silbe2013-07-291-0/+3
|
* Add support for uid in Xapian query for Sugar 0.84+ find() APISascha Silbe2013-07-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | With the Sugar 0.84+ API (without version support), there are three ways to look up the metadata of a single entry: 1. get_properties(uid) 2. find({'uid': uid}, {}) 3. find({'query': 'uid:' + uid}, {}) The former two were already supported by explicit conversion inside the API adapter class. The last one matches the uid inside a Xapian query string. This is more tricky to support as the string gets parsed by Xapian, not ourselves. We're going the simple route for now and just add a 'uid' compatibility prefix for our custom Xapian query parser. This will leak some Sugar API details to other APIs. If any issue comes up because of that, we'll need to pass in different sets of prefixes to Index.find() for each query, based on which API was used.
* Fix handling of non-ASCII data pathsSascha Silbe2013-03-021-8/+10
| | | | | | | | For the native interface, we switch to using byte arrays, which is the only sane way to handle paths on POSIX file systems. For the Sugar v2 interface, we assume UTF-8 representation, like Sugar does.
* Optionally add extension to checked out files based on MIME typeSascha Silbe2012-08-071-3/+22
| | | | | | | | | | | | | If available, gdatastore will now use sugar.mime to guess an extension to add to checked out files, based on their MIME type. The outside world (including emacs) is still surprisingly focused on file extensions rather than MIME types. By adding an extension to the file names returned by gdatastore we help other software that has to interface with legacy components. The alternative would be to add code to every piece of glue code to guess the extension and rename the file in a race-free way. Doing it in gdatastore reduces the overall complexity of the software system.
* add preliminary support for passing data by fdSascha Silbe2012-04-242-0/+106
| | | | | | | | | | | | | | | | | | | Passing data out-of-band using data paths has a couple of issues (different user, chroot, ownership / deletion, in-place modification by callers, etc.) that passing data via file descriptors can avoid. Recent versions of D-Bus and python-dbus have support for fd passing, so we can add alternative versions of the functions that take a data path and have the alternatives take a file descriptor instead. Support for this is still suboptimal as we make a copy and pass a path internally. We can easily improve on that later as it's just a matter of performance, not functionality. We may even consider dropping the non-fd counterparts. However, since D-Bus still does not support a "maybe" type, we'll need alternative versions of these calls that don't take a file descriptor, for use with metadata-only entries. We could also pass a reference to /dev/null, but that's more a hack than a solution.
* Add support for rebuilding index from gitSascha Silbe2012-04-221-8/+113
| | | | | | | | | | | | | We're already storing full metadata in git, using the Xapian index only for performance reasons. By adding support for rebuilding or updating the index based on what's in git, we can recover from index corruptions and interrupted execution (power loss, crash). As an additional benefit, adventurous users can synchronise their data stores using git fetch, forcing gdatastore to update the index by removing the last_object_id file. gdatastore before b3a5dad stored various data types as D-Bus types in the git commit messages. Compatibility with these versions is provided by removing the D-Bus type information on the fly before parsing.
* Store metadata as pure Python data types in gitSascha Silbe2012-04-221-1/+6
| | | | | | | | Pure Python data types can be safely parsed using ast.literal_eval(), removing the need for unsafe evaluation. Previously, numeric data was stored as dbus types (e.g. "dbus.Int32(0, variant_level=1)").
* setup.py: fix support for installing without root prefixSascha Silbe2012-04-221-1/+1
| | | | | | | 8bce5a1 broke installation without --root= because self.root is None in that case. Make sure we're using a string for len() even if self.root is None.
* tests: properly clean up non-directories in ~/.gdatastoreSascha Silbe2012-04-221-1/+5
| | | | | shutil.rmtree() fails when trying to delete non-directories, so we need to delete them explicitly using os.remove().
* tests: add compatibility with Python 2.7Sascha Silbe2012-04-221-4/+4
| | | | | | Python 2.7 dropped the unittest.TestCase._exc_info() method. In Python 2.6 it was just a wrapper around sys.exc_info(), so use that directly, like Python 2.7 does.
* Don't record parent version as git commitSascha Silbe2012-03-061-15/+1
| | | | | | | | | | | | | For reasons explained in ad061c0, we can't rely on the ancestry information (chain of parent commits) stored in git being complete - at least not without doing extensive additional processing (recreating branch history using rebase). Additionally, storing the parent commit caused deleted entries to still be referenced if there were more recent commits based upon them that hadn't also been deleted, causing storage space not to be reclaimed. For now, we simply don't record ancestry directly in git. We still have all the information in the metadata (so no information loss) and don't actually use the ancestry information stored in git.
* Allow restoring root version even if non-root versions already existSascha Silbe2012-02-201-4/+3
| | | | | | | | | | | | | | | | | | | Restoring a version that has no parent with a tree_id that we already have entries for can be indicative of a bug in the caller (restoring entries in the wrong order) and causes inconsistencies in the git repository (as the root commits don't match). For that reason, we refused to store the (new) root version. However under certain conditions the above can happen even without any component being broken: Since we allow the user to delete individual versions, the root version may have been deleted even if more recent entries were kept. If the user took a backup before deleting the root version and tries to restore this backup, restore() will encounter exactly the situation described above. Explicitly skipping this check for restore() suffices for now, but we should reexamine our usage of git (branches) when adding support for recovering from a broken Xapian index.
* Fix DBus signature for restore() (gdatastore native interface)Sascha Silbe2012-02-201-1/+1
| | | | | | | | InternalApi.save() returns the identifiers for the new entry, so we need to either wrap the callback to drop the identifiers (like we do in DBusApiSugarV2.update()) or adjust the DBus signature for DBusApiNativeV1.restore(). While the caller is supposed to pass in all identifiers, it doesn't hurt to return what was actually used.
* Allow restoring orphan versionsSascha Silbe2012-01-211-7/+5
| | | | | | | | | | | | | | | | In order to support removing intermediate versions (on explicit user action or as part of automatic space reduction) we should not require the parent version to exist when restoring versions from backup. At least the Restore activity needs to be careful to never restore the child before the parent, otherwise we'd loose information in git (the parent commit id) that would have been recoverable. The previous check in restore() would have caught that, but also prevents restoring from backups which are missing intermediate versions (because they have been deleted). Alternatives: * Let gdatastore (and thus Backup) store "fake" intermediate versions on delete.
* Remove old notesSascha Silbe2011-12-201-8/+0
| | | | | STORAGE contained some brainstorming around how to store Journal entries in git and doesn't reflect the current design.
* Fix metadata-only updates for Sugar v2 APISascha Silbe2011-10-111-9/+12
| | | | | path='' means the caller wants to update only the metadata and "inherit" the data from the previous version.
* Pretty-print metadata in git commit messageSascha Silbe2011-09-291-1/+14
| | | | This is useful for manual inspection of the git repository.
* Don't index terms longer than the hardcoded Xapian limitSascha Silbe2011-08-221-4/+6
| | | | Xapian has a hardcoded limit of 245 characters for terms.
* Fix indexing on non-standard propertiesSascha Silbe2011-08-221-1/+1
| | | | We accidentally used the value as prefix and vice-versa.
* start implementing native APISascha Silbe2011-08-225-11/+320
|
* Implement find_unique_values()Sascha Silbe2011-08-222-1/+13
| | | | Previously it returned only a fixed set of values to satisfy the test suite.
* InternalApi: don't choke on empty path if delete_after is setSascha Silbe2011-08-221-1/+1
| | | | delete_after should be ignored if path is empty.
* Honor the delete_after flagSascha Silbe2011-07-091-0/+4
|
* Fix indexing of non-string (e.g. numeric) property values as termsSascha Silbe2011-07-091-6/+8
|
* setup.py: fix --root support for D-Bus service filesSascha Silbe2011-07-061-1/+1
|
* runalltests.py: Fix data store process exit detectionSascha Silbe2011-05-161-8/+3
| | | | | | | | The reason waiting for the data store process to exit and release its bus name was unreliable was that we used a name that it is not (yet) providing. Python-dbus explicitly calls GetNameOwner upon invocation of watch_name_owner(), so we would get a callback right away instead of hanging because the name doesn't exist.
* Add and use signal distribution infrastructureSascha Silbe2011-05-151-3/+36
| | | | | | | Once we have multiple D-Bus interfaces, we need to send signals on all of them. Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
* get completely rid of in-memory metadata storageSascha Silbe2011-05-152-5/+6
| | | | Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
* Make sure we're the primary owner of the Sugar data store D-Bus service nameSascha Silbe2011-05-151-1/+2
| | | | | | | | | Having several different data store processes running, potentially serving disjunct API versions (either because of race conditions or because several different implementations are installed) would be a major source of confusion and a recipe for disaster. Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
* Retry opening the Xapian database if another process still has the lockSascha Silbe2011-05-141-2/+12
| | | | | | This should help with situations where the new gdatastore process is already starting up (on a new session bus) while the old one is still busy shutting down (see also: SL#1257).
* runalltests.py: wait long enough between testsSascha Silbe2011-05-141-1/+13
| | | | | | | | | For some unknown reason, we need to wait a bit more even after D-Bus acknowledged the service has shut down. Otherwise the following exception will happen when we first try to access the data store in the next test: DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.1 was not provided by any .service files
* runalltests.py: clean entire data store, not just gitSascha Silbe2011-05-141-1/+6
| | | | | | | | | If we don't clean out the index, the second and following tests will fail because they operate on the metadata (but not data) left by the previous test(s). All we're interested in keeping across tests are the log files, so remove everything else.
* setup.py: add 'test' command to invoke test suiteSascha Silbe2011-05-141-1/+19
|
* runalltests.py: adapt to source layout changesSascha Silbe2011-05-141-1/+1
|
* add installerSascha Silbe2011-04-122-0/+99
|
* move src/gdatastore to top level (distutils-extra convention)Sascha Silbe2011-04-103-0/+0
|
* Fix D-Bus marshalling of (byte) strings.Sascha Silbe2011-04-101-5/+6
| | | | | D-Bus transmits Python (byte) strings as D-Bus (character) strings by default, so we need to explicitly convert them to D-Bus ByteArrays.
* fix full text searchSascha Silbe2011-04-101-1/+1
|
* add standard property descriptionSascha Silbe2011-04-101-0/+1
|
* first working implementationSascha Silbe2011-04-107-219/+823
|
* initialise git repositorySascha Silbe2011-04-091-0/+33
|
* add framework for Sugar data store API v1Sascha Silbe2011-04-084-3/+962
|
* add .gitignore to ignore compiled Python modulesSascha Silbe2011-04-081-0/+1
|