Patchwork [5,of,9] dagop: use smartset.min() in revdescendants() generator

login
register
mail settings
Submitter Yuya Nishihara
Date June 25, 2017, 3:26 a.m.
Message ID <49f3b0640a146b5a6366.1498361174@mimosa>
Download mbox | patch
Permalink /patch/21686/
State Accepted
Headers show

Comments

Yuya Nishihara - June 25, 2017, 3:26 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1498220110 -32400
#      Fri Jun 23 21:15:10 2017 +0900
# Node ID 49f3b0640a146b5a6366d13c0f02d751d22ef8c0
# Parent  71cadea3248d853fa0b297388f704ec11cc63e4c
dagop: use smartset.min() in revdescendants() generator

All callers pass the result of revset.getset(), which should be a smartset.

Patch

diff --git a/mercurial/dagop.py b/mercurial/dagop.py
--- a/mercurial/dagop.py
+++ b/mercurial/dagop.py
@@ -91,9 +91,7 @@  def _genrevdescendants(repo, revs, follo
         cut = None
 
     cl = repo.changelog
-    # XXX this should be 'parentset.min()' assuming 'parentset' is a
-    # smartset (and if it is not, it should.)
-    first = min(revs)
+    first = revs.min()
     nullrev = node.nullrev
     if first == nullrev:
         # Are there nodes with a null first parent and a non-null