##// END OF EJS Templates
merge with stable
Matt Mackall -
r25580:a6998394 merge default
parent child Browse files
Show More
@@ -1480,41 +1480,34 b' static int index_find_node(indexObject *'
1480 return -2;
1480 return -2;
1481 }
1481 }
1482
1482
1483 static PyObject *raise_revlog_error(void)
1483 static void raise_revlog_error(void)
1484 {
1484 {
1485 static PyObject *errclass;
1485 PyObject *mod = NULL, *dict = NULL, *errclass = NULL;
1486 PyObject *mod = NULL, *errobj;
1487
1488 if (errclass == NULL) {
1489 PyObject *dict;
1490
1491 mod = PyImport_ImportModule("mercurial.error");
1492 if (mod == NULL)
1493 goto classfail;
1494
1486
1495 dict = PyModule_GetDict(mod);
1487 mod = PyImport_ImportModule("mercurial.error");
1496 if (dict == NULL)
1488 if (mod == NULL) {
1497 goto classfail;
1489 goto cleanup;
1498
1499 errclass = PyDict_GetItemString(dict, "RevlogError");
1500 if (errclass == NULL) {
1501 PyErr_SetString(PyExc_SystemError,
1502 "could not find RevlogError");
1503 goto classfail;
1504 }
1505 Py_INCREF(errclass);
1506 Py_DECREF(mod);
1507 }
1490 }
1508
1491
1509 errobj = PyObject_CallFunction(errclass, NULL);
1492 dict = PyModule_GetDict(mod);
1510 if (errobj == NULL)
1493 if (dict == NULL) {
1511 return NULL;
1494 goto cleanup;
1512 PyErr_SetObject(errclass, errobj);
1495 }
1513 return errobj;
1496 Py_INCREF(dict);
1514
1497
1515 classfail:
1498 errclass = PyDict_GetItemString(dict, "RevlogError");
1499 if (errclass == NULL) {
1500 PyErr_SetString(PyExc_SystemError,
1501 "could not find RevlogError");
1502 goto cleanup;
1503 }
1504
1505 /* value of exception is ignored by callers */
1506 PyErr_SetString(errclass, "RevlogError");
1507
1508 cleanup:
1509 Py_XDECREF(dict);
1516 Py_XDECREF(mod);
1510 Py_XDECREF(mod);
1517 return NULL;
1518 }
1511 }
1519
1512
1520 static PyObject *index_getitem(indexObject *self, PyObject *value)
1513 static PyObject *index_getitem(indexObject *self, PyObject *value)
@@ -266,7 +266,7 b' def diff(context, mapping, args):'
266
266
267 def getpatterns(i):
267 def getpatterns(i):
268 if i < len(args):
268 if i < len(args):
269 s = args[i][1].strip()
269 s = stringify(args[i][0](context, mapping, args[i][1])).strip()
270 if s:
270 if s:
271 return [s]
271 return [s]
272 return []
272 return []
@@ -2571,6 +2571,13 b' Test diff function:'
2571 @@ -0,0 +1,1 @@
2571 @@ -0,0 +1,1 @@
2572 +third
2572 +third
2573
2573
2574 $ hg log -r 8 -T "{diff('FOURTH'|lower)}"
2575 diff -r 29114dbae42b -r 95c24699272e fourth
2576 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2577 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000
2578 @@ -0,0 +1,1 @@
2579 +second
2580
2574 $ cd ..
2581 $ cd ..
2575
2582
2576
2583
General Comments 0
You need to be logged in to leave comments. Login now