[PATCH 1 of 7] parsers: remove unreachable and invalid code in index_ancestors

Mads Kiilerich mads at kiilerich.com
Mon Feb 24 16:19:10 CST 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1393278133 -3600
#      Mon Feb 24 22:42:13 2014 +0100
# Node ID 9f00c23a26e019f70f90b0501b2b8fa587c85292
# Parent  1716a2671ec77fe95ee788e2dbf33876fba63bf5
parsers: remove unreachable and invalid code in index_ancestors

The function normally returns a list. Returning a single element instead of a
list with one element would be weird.

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1529,10 +1529,6 @@
 		ret = gca;
 		Py_INCREF(gca);
 	}
-	else if (PyList_GET_SIZE(gca) == 1) {
-		ret = PyList_GET_ITEM(gca, 0);
-		Py_INCREF(ret);
-	}
 	else ret = find_deepest(self, gca);
 
 done:


More information about the Mercurial-devel mailing list