diff -r e999b59d6eb1 -r d83b189aef83 mercurial/dagop.py --- a/mercurial/dagop.py Tue Jun 20 22:11:23 2017 +0900 +++ b/mercurial/dagop.py Tue Jun 20 22:26:52 2017 +0900 @@ -98,11 +98,15 @@ if first == nullrev: # Are there nodes with a null first parent and a non-null # second one? Maybe. Do we care? Probably not. + yield first for i in cl: yield i else: seen = set(revs) - for i in cl.revs(first + 1): + for i in cl.revs(first): + if i in seen: + yield i + continue for x in cl.parentrevs(i)[:cut]: if x != nullrev and x in seen: seen.add(i) @@ -110,7 +114,8 @@ break def revdescendants(repo, revs, followfirst): - """Like revlog.descendants() but supports followfirst.""" + """Like revlog.descendants() but supports additional options, includes + the given revs themselves, and returns a smartset""" gen = _genrevdescendants(repo, revs, followfirst) return generatorset(gen, iterasc=True)