Patchwork [7,of,7] revset: rename findaliases() to expandaliases()

login
register
mail settings
Submitter Yuya Nishihara
Date April 13, 2016, 3:55 p.m.
Message ID <8108442370edefbc14c9.1460562919@mimosa>
Download mbox | patch
Permalink /patch/14586/
State Accepted
Commit 8d398155bfda3a98e664af74096f0e405cc7dd09
Headers show

Comments

Yuya Nishihara - April 13, 2016, 3:55 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1456754295 -32400
#      Mon Feb 29 22:58:15 2016 +0900
# Node ID 8108442370edefbc14c94e5153f50aa55a00e21d
# Parent  389fab2ad6694be868f423e69e5c71bfffd62a8e
revset: rename findaliases() to expandaliases()

This function returns a full tree of alias expansion applied, which sounds
different from what "findaliases" would do.
Sean Farley - April 13, 2016, 5:16 p.m.
Yuya Nishihara <yuya@tcha.org> writes:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1456754295 -32400
> #      Mon Feb 29 22:58:15 2016 +0900
> # Node ID 8108442370edefbc14c94e5153f50aa55a00e21d
> # Parent  389fab2ad6694be868f423e69e5c71bfffd62a8e
> revset: rename findaliases() to expandaliases()
>
> This function returns a full tree of alias expansion applied, which sounds
> different from what "findaliases" would do.

This series looks to just be moving code around to a new class and
documenting existing code better. This looks fine to me.
Matt Mackall - April 13, 2016, 10:33 p.m.
On Thu, 2016-04-14 at 00:55 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1456754295 -32400
> #      Mon Feb 29 22:58:15 2016 +0900
> # Node ID 8108442370edefbc14c94e5153f50aa55a00e21d
> # Parent  389fab2ad6694be868f423e69e5c71bfffd62a8e
> revset: rename findaliases() to expandaliases()

These are queued for default, thanks.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3508,7 +3508,7 @@  def debugrevspec(ui, repo, expr, **opts)
     if ui.verbose:
         tree = revset.parse(expr, lookup=repo.__contains__)
         ui.note(revset.prettyformat(tree), "\n")
-        newtree = revset.findaliases(ui, tree)
+        newtree = revset.expandaliases(ui, tree)
         if newtree != tree:
             ui.note("* expanded:\n", revset.prettyformat(newtree), "\n")
         tree = newtree
diff --git a/mercurial/parser.py b/mercurial/parser.py
--- a/mercurial/parser.py
+++ b/mercurial/parser.py
@@ -239,7 +239,8 @@  class alias(object):
         self.error = err
         self.replacement = replacement
         # whether own `error` information is already shown or not.
-        # this avoids showing same warning multiple times at each `findaliases`.
+        # this avoids showing same warning multiple times at each
+        # `expandaliases`.
         self.warned = False
 
 class basealiasrules(object):
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2256,7 +2256,7 @@  class _aliasrules(parser.basealiasrules)
     _parse = staticmethod(_parsealias)
     _getlist = staticmethod(getlist)
 
-def findaliases(ui, tree, showwarning=None):
+def expandaliases(ui, tree, showwarning=None):
     aliases = _aliasrules.buildmap(ui.configitems('revsetalias'))
     tree = _aliasrules.expand(aliases, tree)
     if showwarning:
@@ -2328,7 +2328,7 @@  def matchany(ui, specs, repo=None):
 
 def _makematcher(ui, tree, repo):
     if ui:
-        tree = findaliases(ui, tree, showwarning=ui.warn)
+        tree = expandaliases(ui, tree, showwarning=ui.warn)
     tree = foldconcat(tree)
     weight, tree = optimize(tree, True)
     posttreebuilthook(tree, repo)