Patchwork [2,of,7,V3] revset: remove the last usage of "%d" for a non-revision entry

login
register
mail settings
Submitter Boris Feld
Date Jan. 14, 2019, 2:27 p.m.
Message ID <4005f4a1c34ec9121983.1547476038@localhost.localdomain>
Download mbox | patch
Permalink /patch/37730/
State Accepted
Headers show

Comments

Boris Feld - Jan. 14, 2019, 2:27 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1547132587 -3600
#      Thu Jan 10 16:03:07 2019 +0100
# Node ID 4005f4a1c34ec9121983bb07b4a1895892645f30
# Parent  15458ddc966d002a781d0be59cf2fa961790aa4c
# EXP-Topic revs-efficiency
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 4005f4a1c34e
revset: remove the last usage of "%d" for a non-revision entry

In order to fix an important bug, we are about to narrow the semantic of "%d"
in revset. This is one of the few exceptions that we need to get rid of before
being able to fix the bug.

See the later semantic narrowing changeset for full rationale on the semantic
change.

Patch

diff --git a/mercurial/exchangev2.py b/mercurial/exchangev2.py
--- a/mercurial/exchangev2.py
+++ b/mercurial/exchangev2.py
@@ -98,8 +98,8 @@  def pull(pullop):
         relevantcsetnodes = set()
         clnode = repo.changelog.node
 
-        for rev in repo.revs(b'ancestors(%ln, %d)',
-                             pullheads, pullop.depth - 1):
+        query = b'ancestors(%ln, %s)'
+        for rev in repo.revs(query, pullheads, pullop.depth - 1):
             relevantcsetnodes.add(clnode(rev))
 
         csetrelevantfilter = lambda n: n in relevantcsetnodes