Patchwork [1,of,2] revset: use nullrev constant in merge()

login
register
mail settings
Submitter Yuya Nishihara
Date June 9, 2019, 1:54 p.m.
Message ID <282376c97e4ff13a310c.1560088476@mimosa>
Download mbox | patch
Permalink /patch/40388/
State Accepted
Headers show

Comments

Yuya Nishihara - June 9, 2019, 1:54 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1560086302 -32400
#      Sun Jun 09 22:18:22 2019 +0900
# Node ID 282376c97e4ff13a310c8688eb1e9f393f41b3a3
# Parent  f163e2b2594cf6fe4f5b77505f9b193c94629650
revset: use nullrev constant in merge()
Pulkit Goyal - June 11, 2019, 1:56 p.m.
On Sun, Jun 9, 2019 at 4:57 PM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1560086302 -32400
> #      Sun Jun 09 22:18:22 2019 +0900
> # Node ID 282376c97e4ff13a310c8688eb1e9f393f41b3a3
> # Parent  f163e2b2594cf6fe4f5b77505f9b193c94629650
> revset: use nullrev constant in merge()
>

Queued the series, many thanks!

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1361,7 +1361,8 @@  def merge(repo, subset, x):
     # i18n: "merge" is a keyword
     getargs(x, 0, 0, _("merge takes no arguments"))
     cl = repo.changelog
-    return subset.filter(lambda r: cl.parentrevs(r)[1] != -1,
+    nullrev = node.nullrev
+    return subset.filter(lambda r: cl.parentrevs(r)[1] != nullrev,
                          condrepr='<merge>')
 
 @predicate('branchpoint()', safe=True)