Patchwork [1,of,3,stable,V3] ancestor.deepest: sort revs in C version

login
register
mail settings
Submitter elson
Date July 26, 2013, 3:13 a.m.
Message ID <CA+jbiHEhYjAXi6tr6L55Cz5G2p+YTNmW1XnbrBTJ_q_-wg8J=Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/1971/
State Accepted
Commit 8704477ad3b6b6ffd93f0ab33cfb4b7c8ce81247
Headers show

Comments

elson - July 26, 2013, 3:13 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1374787237 25200
#      Thu Jul 25 14:20:37 2013 -0700
# Branch stable
# Node ID 8704477ad3b6b6ffd93f0ab33cfb4b7c8ce81247
# Parent  725507cd52169b979ecb67b51a177d6e99ae4616
ancestor.deepest: sort revs in C version

This isn't strictly necessary, but it makes the code more consistent with
the
Python version.

Patch

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1311,6 +1311,9 @@ 
         goto bail;
     }

+    if (PyList_Sort(revs) == -1)
+        goto bail;
+
     for (i = 0; i < revcount; i++) {
         int n = (int)PyInt_AsLong(PyList_GET_ITEM(revs, i));
         long b = 1l << i;