##// END OF EJS Templates
dirstate-item: `dirstate_item_from_v1_data` replaces make_dirstate_item...
marmoute -
r48757:3337eec2 default
parent child Browse files
Show More
@@ -44,21 +44,6 b' static PyObject *dict_new_presized(PyObj'
44 44 return _dict_new_presized(expected_size);
45 45 }
46 46
47 static inline dirstateItemObject *make_dirstate_item(char state, int mode,
48 int size, int mtime)
49 {
50 dirstateItemObject *t =
51 PyObject_New(dirstateItemObject, &dirstateItemType);
52 if (!t) {
53 return NULL;
54 }
55 t->state = state;
56 t->mode = mode;
57 t->size = size;
58 t->mtime = mtime;
59 return t;
60 }
61
62 47 static PyObject *dirstate_item_new(PyTypeObject *subtype, PyObject *args,
63 48 PyObject *kwds)
64 49 {
@@ -201,7 +186,7 b' static PyObject *dirstate_item_need_dela'
201 186 }
202 187 };
203 188
204 /* This will never change since it's bound to V1, unlike `make_dirstate_item`
189 /* This will never change since it's bound to V1
205 190 */
206 191 static inline dirstateItemObject *
207 192 dirstate_item_from_v1_data(char state, int mode, int size, int mtime)
@@ -795,7 +780,7 b' static PyObject *pack_dirstate(PyObject '
795 780 /* See pure/parsers.py:pack_dirstate for why we do
796 781 * this. */
797 782 mtime = -1;
798 mtime_unset = (PyObject *)make_dirstate_item(
783 mtime_unset = (PyObject *)dirstate_item_from_v1_data(
799 784 state, mode, size, mtime);
800 785 if (!mtime_unset) {
801 786 goto bail;
@@ -1088,7 +1073,7 b' static void module_init(PyObject *mod)'
1088 1073 revlog_module_init(mod);
1089 1074
1090 1075 capsule = PyCapsule_New(
1091 make_dirstate_item,
1076 dirstate_item_from_v1_data,
1092 1077 "mercurial.cext.parsers.make_dirstate_item_CAPI", NULL);
1093 1078 if (capsule != NULL)
1094 1079 PyModule_AddObject(mod, "make_dirstate_item_CAPI", capsule);
General Comments 0
You need to be logged in to leave comments. Login now