Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG9719e118e4af: cext: remove unused variables
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
| hg-reviewers |
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/cext/manifest.c (2 lines) | |||
| M | mercurial/cext/revlog.c (5 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| eed8830bab8b | c59e7bed8924 | Joerg Sonnenberger | Jul 16 2020, 1:48 PM |
| free(tovisit); | free(tovisit); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| static int add_roots_get_min(indexObject *self, PyObject *roots, char *phases, | static int add_roots_get_min(indexObject *self, PyObject *roots, char *phases, | ||||
| char phase) | char phase) | ||||
| { | { | ||||
| Py_ssize_t len = index_length(self); | Py_ssize_t len = index_length(self); | ||||
| PyObject *iter; | |||||
| PyObject *item; | PyObject *item; | ||||
| PyObject *iterator; | PyObject *iterator; | ||||
| int rev, minrev = -1; | int rev, minrev = -1; | ||||
| char *node; | char *node; | ||||
| if (!PySet_Check(roots)) | if (!PySet_Check(roots)) | ||||
| return -2; | return -2; | ||||
| iterator = PyObject_GetIter(roots); | iterator = PyObject_GetIter(roots); | ||||
| static PyObject *compute_phases_map_sets(indexObject *self, PyObject *args) | static PyObject *compute_phases_map_sets(indexObject *self, PyObject *args) | ||||
| { | { | ||||
| /* 0: public (untracked), 1: draft, 2: secret, 32: archive, | /* 0: public (untracked), 1: draft, 2: secret, 32: archive, | ||||
| 96: internal */ | 96: internal */ | ||||
| static const char trackedphases[] = {1, 2, 32, 96}; | static const char trackedphases[] = {1, 2, 32, 96}; | ||||
| PyObject *ret = NULL; | PyObject *ret = NULL; | ||||
| PyObject *roots = Py_None; | PyObject *roots = Py_None; | ||||
| PyObject *idx = NULL; | |||||
| PyObject *pyphase = NULL; | PyObject *pyphase = NULL; | ||||
| PyObject *pyrev = NULL; | PyObject *pyrev = NULL; | ||||
| PyObject *phaseroots = NULL; | PyObject *phaseroots = NULL; | ||||
| PyObject *phasessize = NULL; | PyObject *phasessize = NULL; | ||||
| PyObject *phasesets[4] = {NULL, NULL, NULL, NULL}; | PyObject *phasesets[4] = {NULL, NULL, NULL, NULL}; | ||||
| Py_ssize_t len = index_length(self); | Py_ssize_t len = index_length(self); | ||||
| const char *currentphase; | |||||
| char *phases = NULL; | char *phases = NULL; | ||||
| int minphaserev = -1, rev, i; | int minphaserev = -1, rev, i; | ||||
| const int numphases = (int)(sizeof(phasesets) / sizeof(phasesets[0])); | const int numphases = (int)(sizeof(phasesets) / sizeof(phasesets[0])); | ||||
| if (!PyArg_ParseTuple(args, "O", &roots)) | if (!PyArg_ParseTuple(args, "O", &roots)) | ||||
| return NULL; | return NULL; | ||||
| if (roots == NULL || !PyDict_Check(roots)) { | if (roots == NULL || !PyDict_Check(roots)) { | ||||
| PyErr_SetString(PyExc_TypeError, "roots must be a dictionary"); | PyErr_SetString(PyExc_TypeError, "roots must be a dictionary"); | ||||
| Py_DECREF(pyrev); | Py_DECREF(pyrev); | ||||
| goto release; | goto release; | ||||
| } | } | ||||
| Py_DECREF(pyrev); | Py_DECREF(pyrev); | ||||
| } | } | ||||
| phaseroots = _dict_new_presized(numphases); | phaseroots = _dict_new_presized(numphases); | ||||
| if (phaseroots == NULL) | if (phaseroots == NULL) | ||||
| goto release; | goto release; | ||||
| for (int i = 0; i < numphases; ++i) { | for (i = 0; i < numphases; ++i) { | ||||
| pyphase = PyInt_FromLong(trackedphases[i]); | pyphase = PyInt_FromLong(trackedphases[i]); | ||||
| if (pyphase == NULL) | if (pyphase == NULL) | ||||
| goto release; | goto release; | ||||
| if (PyDict_SetItem(phaseroots, pyphase, phasesets[i]) == -1) { | if (PyDict_SetItem(phaseroots, pyphase, phasesets[i]) == -1) { | ||||
| Py_DECREF(pyphase); | Py_DECREF(pyphase); | ||||
| goto release; | goto release; | ||||
| } | } | ||||
| Py_DECREF(phasesets[i]); | Py_DECREF(phasesets[i]); | ||||
I'll remove this one too in flight.