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

login
register
mail settings
Submitter Boris Feld
Date Jan. 11, 2019, 11:29 a.m.
Message ID <427247e84e29c144321d.1547206145@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/37660/
State Accepted
Headers show

Comments

Boris Feld - Jan. 11, 2019, 11:29 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1547132587 -3600
#      Thu Jan 10 16:03:07 2019 +0100
# Node ID 427247e84e29c144321d21a825d371458b5d3e1a
# Parent  a71dd521a4a53b19e89f9ad9c20fb85e604783c6
# EXP-Topic revs-efficiency
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 427247e84e29
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, %d)' % (pullop.depth - 1)
+        for rev in repo.revs(query, pullheads):
             relevantcsetnodes.add(clnode(rev))
 
         csetrelevantfilter = lambda n: n in relevantcsetnodes