Patchwork [1,of,4,nullrev] revset: drop unnecessary calls of getall() with empty argument

login
register
mail settings
Submitter Yuya Nishihara
Date March 4, 2015, 3:19 p.m.
Message ID <a72a044114ebbbd63b61.1425482373@mimosa>
Download mbox | patch
Permalink /patch/7898/
State Accepted
Headers show

Comments

Yuya Nishihara - March 4, 2015, 3:19 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1420875696 -32400
#      Sat Jan 10 16:41:36 2015 +0900
# Node ID a72a044114ebbbd63b6128b4784c34bddd0b7b4d
# Parent  4464f1ebd182587c44153ce7ec7d104aaccbcdc7
revset: drop unnecessary calls of getall() with empty argument

If x is None, getall(repo, subset, x) == subset.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -746,7 +746,7 @@  def destination(repo, subset, x):
     if x is not None:
         sources = getset(repo, fullreposet(repo), x)
     else:
-        sources = getall(repo, fullreposet(repo), x)
+        sources = fullreposet(repo)
 
     dests = set()
 
@@ -1347,7 +1347,7 @@  def origin(repo, subset, x):
     if x is not None:
         dests = getset(repo, fullreposet(repo), x)
     else:
-        dests = getall(repo, fullreposet(repo), x)
+        dests = fullreposet(repo)
 
     def _firstsrc(rev):
         src = _getrevsource(repo, rev)