manifest: remove the dirs function from the manifest

Summary:
There is no custom implementation for manfiest.dirs(). Generally speaking
the custom implementation is a good thing but doing the migration in the
current python codebase doesn't seem worth while at the moment.

Reviewed By: quark-zju

Differential Revision: D16775351

fbshipit-source-id: c428860d21088a50a0f754dc20d6ee224d2eae32
This commit is contained in:
Stefan Filip 2019-08-26 10:45:58 -07:00 committed by Facebook Github Bot
parent c36d604b3f
commit 98b32be924
3 changed files with 1 additions and 23 deletions

View File

@ -416,15 +416,6 @@ static PyObject* treemanifest_keys(py_treemanifest* self) {
return result;
}
static PyObject* treemanifest_dirs(py_treemanifest* self) {
PythonObj module = PyImport_ImportModule("edenscm.mercurial.util");
PythonObj dirstype = module.getattr("dirs");
PyObject* args = Py_BuildValue("(O)", self);
PythonObj result = dirstype.call(args);
return result.returnval();
}
static PyObject*
treemanifest_diff(PyObject* o, PyObject* args, PyObject* kwargs) {
py_treemanifest* self = (py_treemanifest*)o;
@ -1635,10 +1626,6 @@ static PyMethodDef treemanifest_methods[] = {
(PyCFunction)treemanifest_diff,
METH_VARARGS | METH_KEYWORDS,
"performs a diff of the given two manifests\n"},
{"dirs",
(PyCFunction)treemanifest_dirs,
METH_NOARGS,
"gets a collection of all the directories in this manifest"},
{"filesnotin",
(PyCFunction)treemanifest_filesnotin,
METH_VARARGS | METH_KEYWORDS,

View File

@ -387,7 +387,7 @@ class basectx(object):
return patch.diff(self._repo, ctx2, self, match=match, opts=diffopts)
def dirs(self):
return self._manifest.dirs()
return util.dirs(self._manifest)
def hasdir(self, dir):
return self._manifest.hasdir(dir)

View File

@ -576,15 +576,6 @@ class ctreemanifesttests(unittest.TestCase):
self.assertFalse("abc" in a)
self.assertFalse(None in a)
def testDirs(self):
a = cstore.treemanifest(FakeDataStore())
zflags = hashflags()
a.set("abc/z", *zflags)
dirs = a.dirs()
self.assertTrue("abc" in dirs)
self.assertFalse("abc/z" in dirs)
def testNonZero(self):
a = cstore.treemanifest(FakeDataStore())
self.assertFalse(bool(a))