Patchwork revset: optimize for destination() being "inefficient"

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 17, 2016, 5:48 p.m.
Message ID <50a7bbe82bd3b63a9346.1476726538@madski>
Download mbox | patch
Permalink /patch/17155/
State Accepted
Headers show

Comments

Mads Kiilerich - Oct. 17, 2016, 5:48 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1476726516 -7200
#      Mon Oct 17 19:48:36 2016 +0200
# Node ID 50a7bbe82bd3b63a934640b1480ee643cf14ec5f
# Parent  5cb830801855dbb63e98b948e355bc995d295bf3
revset: optimize for destination() being "inefficient"

destination() will scan through the whole subset and read extras for each
revision to get its source.
Pierre-Yves David - Oct. 17, 2016, 10:33 p.m.
On 10/17/2016 07:48 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1476726516 -7200
> #      Mon Oct 17 19:48:36 2016 +0200
> # Node ID 50a7bbe82bd3b63a934640b1480ee643cf14ec5f
> # Parent  5cb830801855dbb63e98b948e355bc995d295bf3
> revset: optimize for destination() being "inefficient"

Sure, pushed, thanks

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2594,7 +2594,7 @@  def _optimize(x, small):
         f = getsymbol(x[1])
         wa, ta = _optimize(x[2], small)
         if f in ('author', 'branch', 'closed', 'date', 'desc', 'file', 'grep',
-                 'keyword', 'outgoing', 'user'):
+                 'keyword', 'outgoing', 'user', 'destination'):
             w = 10 # slow
         elif f in ('modifies', 'adds', 'removes'):
             w = 30 # slower