From e0c820be176a8b48a9cf9a8887d26aa0faa6d296 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sat, 26 Aug 2023 07:58:12 +0200 Subject: [PATCH] update checkoutBranch --- src/runtime/python/pypgf.c | 2 +- src/runtime/python/transactions.c | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index 9f9ea0577..acd73deb8 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -1424,7 +1424,7 @@ static PyMethodDef PGF_methods[] = { {"exprProbability", (PyCFunction)PGF_exprProbability, METH_VARARGS, "Returns the probability of an expression" }, - {"checkoutBranch", (PyCFunction)PGF_checkoutBranch, METH_VARARGS, + {"checkoutBranch", (PyCFunction)PGF_checkoutBranch, METH_NOARGS, "Checks out the latest branch of the repository" }, {"newTransaction", (PyCFunction)PGF_newTransaction, METH_VARARGS, diff --git a/src/runtime/python/transactions.c b/src/runtime/python/transactions.c index d585c3170..585b931b8 100644 --- a/src/runtime/python/transactions.c +++ b/src/runtime/python/transactions.c @@ -10,20 +10,12 @@ PyObject * PGF_checkoutBranch(PGFObject *self, PyObject *args) { - if (!PyArg_ParseTuple(args, "")) - return NULL; - PgfExn err; PgfRevision rev = pgf_checkout_revision(self->db, &err); if (handleError(err) != PGF_EXN_NONE) { return NULL; } - if (rev == 0) { - // is this possible? - PyErr_SetString(PyExc_KeyError, "unknown branch name"); - return NULL; - } pgf_free_revision(self->db, self->revision); self->revision = rev;