Move ref writing to be transaction-based

Rather than having separate write_ref calls, make clients start a
transaction, add some refs, and then commit it. While this doesn't
make it 100% atomic, it makes it easier for us to use an atomic
model, and it means we don't do as much I/O updating the summary
file and such.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
This commit is contained in:
Jasper St. Pierre committed 2013-09-06 20:31:12 -04:00
1 parent bd2948e964
commit 91d3b90c9f
13 files changed
+189 -101

No files matched your search

+9 -11
View File
@@ -130,6 +130,15 @@ gboolean ostree_repo_abort_transaction (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
void ostree_repo_transaction_set_refspec (OstreeRepo *self,
const char *refspec,
const char *checksum);
void ostree_repo_transaction_set_ref (OstreeRepo *self,
const char *remote,
const char *ref,
const char *checksum);
gboolean ostree_repo_has_object (OstreeRepo *self,
OstreeObjectType objtype,
const char *checksum,
@@ -199,17 +208,6 @@ gboolean ostree_repo_resolve_rev (OstreeRepo *self,
char **out_rev,
GError **error);
gboolean ostree_repo_write_ref (OstreeRepo *self,
const char *remote,
const char *name,
const char *rev,
GError **error);
gboolean ostree_repo_write_refspec (OstreeRepo *self,
const char *refspec,
const char *rev,
GError **error);
gboolean ostree_repo_list_refs (OstreeRepo *self,
const char *refspec_prefix,
GHashTable **out_all_refs,