Patchwork [3,of,3,V2] revset: delete _updatedefaultdest as it has no users

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 8, 2015, 7:09 p.m.
Message ID <a2e4da578aafd000e23c.1444331387@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10889/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 8, 2015, 7:09 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1444037625 25200
#      Mon Oct 05 02:33:45 2015 -0700
# Node ID a2e4da578aafd000e23cb6e4f42c8ab3d9a5e493
# Parent  d67e4e13b4eab3b81f90fa58b8e7bcc423e9c543
revset: delete _updatedefaultdest as it has no users

The revset is not used anywhere anymore. We delete the function until we use
(and therefore test it again).
Augie Fackler - Oct. 8, 2015, 9:40 p.m.
On Thu, Oct 08, 2015 at 12:09:47PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1444037625 25200
> #      Mon Oct 05 02:33:45 2015 -0700
> # Node ID a2e4da578aafd000e23cb6e4f42c8ab3d9a5e493
> # Parent  d67e4e13b4eab3b81f90fa58b8e7bcc423e9c543
> revset: delete _updatedefaultdest as it has no users

these are queued, many thanks

>
> The revset is not used anywhere anymore. We delete the function until we use
> (and therefore test it again).
>
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -10,11 +10,10 @@ from __future__ import absolute_import
>  import heapq
>  import re
>
>  from .i18n import _
>  from . import (
> -    destutil,
>      encoding,
>      error,
>      hbisect,
>      match as matchmod,
>      node,
> @@ -523,21 +522,10 @@ def _mergedefaultdest(repo, subset, x):
>              node = nbhs[-1]
>          else:
>              node = nbhs[0]
>      return subset & baseset([repo[node].rev()])
>
> -def _updatedefaultdest(repo, subset, x):
> -    # ``_updatedefaultdest()``
> -
> -    # default destination for update.
> -    # # XXX: Currently private because I expect the signature to change.
> -    # # XXX: - taking rev as arguments,
> -    # # XXX: - bailing out in case of ambiguity vs returning all data.
> -    getargs(x, 0, 0, _("_updatedefaultdest takes no arguments"))
> -    rev = destutil.destupdate(repo)
> -    return subset & baseset([rev])
> -
>  def adds(repo, subset, x):
>      """``adds(pattern)``
>      Changesets that add a file matching pattern.
>
>      The pattern without explicit kind like ``glob:`` is expected to be
> @@ -2144,11 +2132,10 @@ def _hexlist(repo, subset, x):
>      s = subset
>      return baseset([r for r in ls if r in s])
>
>  symbols = {
>      "_mergedefaultdest": _mergedefaultdest,
> -    "_updatedefaultdest": _updatedefaultdest,
>      "adds": adds,
>      "all": getall,
>      "ancestor": ancestor,
>      "ancestors": ancestors,
>      "_firstancestors": _firstancestors,
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -10,11 +10,10 @@  from __future__ import absolute_import
 import heapq
 import re
 
 from .i18n import _
 from . import (
-    destutil,
     encoding,
     error,
     hbisect,
     match as matchmod,
     node,
@@ -523,21 +522,10 @@  def _mergedefaultdest(repo, subset, x):
             node = nbhs[-1]
         else:
             node = nbhs[0]
     return subset & baseset([repo[node].rev()])
 
-def _updatedefaultdest(repo, subset, x):
-    # ``_updatedefaultdest()``
-
-    # default destination for update.
-    # # XXX: Currently private because I expect the signature to change.
-    # # XXX: - taking rev as arguments,
-    # # XXX: - bailing out in case of ambiguity vs returning all data.
-    getargs(x, 0, 0, _("_updatedefaultdest takes no arguments"))
-    rev = destutil.destupdate(repo)
-    return subset & baseset([rev])
-
 def adds(repo, subset, x):
     """``adds(pattern)``
     Changesets that add a file matching pattern.
 
     The pattern without explicit kind like ``glob:`` is expected to be
@@ -2144,11 +2132,10 @@  def _hexlist(repo, subset, x):
     s = subset
     return baseset([r for r in ls if r in s])
 
 symbols = {
     "_mergedefaultdest": _mergedefaultdest,
-    "_updatedefaultdest": _updatedefaultdest,
     "adds": adds,
     "all": getall,
     "ancestor": ancestor,
     "ancestors": ancestors,
     "_firstancestors": _firstancestors,