From patchwork Thu Mar 26 03:14:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,2] osutil._listdir: rename to _listdir_stat From: Siddharth Agarwal X-Patchwork-Id: 8285 Message-Id: <247fb9a8ff9de9026d2b.1427339672@devbig136.prn2.facebook.com> To: Date: Wed, 25 Mar 2015 20:14:32 -0700 # HG changeset patch # User Siddharth Agarwal # Date 1427327009 25200 # Wed Mar 25 16:43:29 2015 -0700 # Node ID 247fb9a8ff9de9026d2b5d58b825da9975a37e5c # Parent 98042b0e19f9a04be3270cecb07915eac3a515cf osutil._listdir: rename to _listdir_stat In upcoming patches we'll add another implementation of listdir on OS X. That implementation will have to fall back to this one under some circumstances, though. We'll make _listdir be able to detect those circumstances and use the right function as appropriate. diff --git a/mercurial/osutil.c b/mercurial/osutil.c --- a/mercurial/osutil.c +++ b/mercurial/osutil.c @@ -286,7 +286,8 @@ return stat; } -static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip) +static PyObject *_listdir_stat(char *path, int pathlen, int keepstat, + char *skip) { PyObject *list, *elem, *stat = NULL, *ret = NULL; char fullpath[PATH_MAX + 10]; @@ -391,6 +392,11 @@ return ret; } +static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip) +{ + return _listdir_stat(path, pathlen, keepstat, skip); +} + static PyObject *statfiles(PyObject *self, PyObject *args) { PyObject *names, *stats;