diff options
Diffstat (limited to 'gdatastore')
-rw-r--r-- | gdatastore/datastore.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gdatastore/datastore.py b/gdatastore/datastore.py index e85cc4f..c0d59d8 100644 --- a/gdatastore/datastore.py +++ b/gdatastore/datastore.py @@ -190,7 +190,6 @@ class DBusApiNativeV1(dbus.service.Object): """ - add a new version with the given ids - there must be no existing entry with the same (tree_id, version_id) - - if parent_id != '' there must be an existing entry (tree_id, parent_id) - if parent_id = '', there must be no existing entry with the same tree_id and no parent_id """ if not tree_id: @@ -499,10 +498,6 @@ class InternalApi(object): raise ValueError('No parent_id given but tree_id already ' 'exists') - elif parent_id: - if not self._index.contains((tree_id, parent_id)): - raise ValueError('Given parent does not exist') - if not tree_id: tree_id = self._gen_uuid() @@ -593,8 +588,11 @@ class InternalApi(object): if not parent_id: return None - return self._git_call('rev-parse', - [_format_ref(tree_id, parent_id)]).strip() + try: + return self._git_call('rev-parse', + [_format_ref(tree_id, parent_id)]).strip() + except GitError: + return None def _format_commit_message(self, metadata): return pprint.pformat(to_native(metadata)) |