revset: switch internal uses and tests to `predecessors` from legacy name
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 27 Apr 2019 22:59:48 -0400
changeset 4624 c9798965b1f4
parent 4623 0adb59b55add
child 4625 a4fde4e3e763
revset: switch internal uses and tests to `predecessors` from legacy name
hgext3rd/evolve/__init__.py
hgext3rd/evolve/evolvecmd.py
hgext3rd/evolve/rewind.py
tests/test-obsolete.t
tests/test-rewind.t
tests/test-sharing.t
tests/test-topic-stack-complex.t
tests/test-uncommit.t
tests/test-userguide.t
--- a/hgext3rd/evolve/__init__.py	Sat Apr 27 22:33:16 2019 -0400
+++ b/hgext3rd/evolve/__init__.py	Sat Apr 27 22:59:48 2019 -0400
@@ -497,7 +497,7 @@
 def _installalias(ui):
     if ui.config('alias', 'odiff', None) is None:
         ui.setconfig('alias', 'odiff',
-                     "diff --hidden --rev 'limit(precursors(.),1)' --rev .",
+                     "diff --hidden --rev 'limit(predecessors(.),1)' --rev .",
                      'evolve')
 
 ### Unstable revset symbol
--- a/hgext3rd/evolve/evolvecmd.py	Sat Apr 27 22:33:16 2019 -0400
+++ b/hgext3rd/evolve/evolvecmd.py	Sat Apr 27 22:59:48 2019 -0400
@@ -204,7 +204,7 @@
         msg = _('skipping %s : we do not handle merge yet\n') % bumped
         ui.write_err(msg)
         return (False, ".")
-    prec = repo.set('last(allprecursors(%d) and public())', bumped.rev()).next()
+    prec = repo.set('last(allpredecessors(%d) and public())', bumped.rev()).next()
     # For now we deny target merge
     if len(prec.parents()) > 1:
         msg = _('skipping: %s: public version is a merge, '
@@ -1120,7 +1120,7 @@
     XXX this woobly function won't survive XXX
     """
     repo = ctx._repo.unfiltered()
-    for base in repo.set('reverse(allprecursors(%d))', ctx.rev()):
+    for base in repo.set('reverse(allpredecessors(%d))', ctx.rev()):
         newer = obsutil.successorssets(ctx._repo, base.node())
         # drop filter and solution including the original ctx
         newer = [n for n in newer if n and ctx.node() not in n]
@@ -1318,7 +1318,7 @@
         ctx = repo[rev]
         unpars = _preparelistctxs(ctx.parents(), lambda p: p.orphan())
         obspars = _preparelistctxs(ctx.parents(), lambda p: p.obsolete())
-        imprecs = _preparelistctxs(repo.set("allprecursors(%n)", ctx.node()),
+        imprecs = _preparelistctxs(repo.set("allpredecessors(%n)", ctx.node()),
                                    lambda p: not p.mutable())
         dsets = divergentsets(repo, ctx)
 
--- a/hgext3rd/evolve/rewind.py	Sat Apr 27 22:33:16 2019 -0400
+++ b/hgext3rd/evolve/rewind.py	Sat Apr 27 22:59:48 2019 -0400
@@ -136,7 +136,7 @@
         rewinded.update(scmutil.revrange(repo, revsto))
     if revsfrom:
         succs = scmutil.revrange(repo, revsfrom)
-        rewinded.update(unfi.revs('precursors(%ld)', succs))
+        rewinded.update(unfi.revs('predecessors(%ld)', succs))
 
     if not rewinded:
         raise error.Abort('no revision to rewind to')
--- a/tests/test-obsolete.t	Sat Apr 27 22:33:16 2019 -0400
+++ b/tests/test-obsolete.t	Sat Apr 27 22:59:48 2019 -0400
@@ -66,9 +66,9 @@
   2
   - 4538525df7e2
 
-Test that obsolete precursors are properly computed
+Test that obsolete predecessors are properly computed
 
-  $ qlog -r 'precursors(.)' --hidden
+  $ qlog -r 'predecessors(.)' --hidden
   2
   - 4538525df7e2
   $ qlog -r .
@@ -110,7 +110,7 @@
   - 4538525df7e2
   3
   - 0d3f46688ccc
-  $ qlog -r 'allprecursors(4)' --hidden
+  $ qlog -r 'allpredecessors(4)' --hidden
   2
   - 4538525df7e2
   3
--- a/tests/test-rewind.t	Sat Apr 27 22:33:16 2019 -0400
+++ b/tests/test-rewind.t	Sat Apr 27 22:59:48 2019 -0400
@@ -802,7 +802,7 @@
 Automatically rewinding the full stack (with --to)
 --------------------------------------------------
 
-  $ hg rewind --hidden --to 'precursors(.)'
+  $ hg rewind --hidden --to 'predecessors(.)'
   rewinded to 2 changesets
   (2 changesets obsoleted)
   working directory is now at 70892f498f29
--- a/tests/test-sharing.t	Sat Apr 27 22:33:16 2019 -0400
+++ b/tests/test-sharing.t	Sat Apr 27 22:59:48 2019 -0400
@@ -534,7 +534,7 @@
   o  3:a06ec1bf97bd  public  fix bug 15 (v2)
   |
   ~
-  $ hg --hidden shortlog -r 'precursors(b1499b0f03ca)'
+  $ hg --hidden shortlog -r 'predecessors(b1499b0f03ca)'
   5:a360947f6faf  draft  fix bug 24 (v2 by bob)
   6:e3f99ce9d9cd  draft  fix bug 24 (v2 by alice)
   $ cat file1
--- a/tests/test-topic-stack-complex.t	Sat Apr 27 22:33:16 2019 -0400
+++ b/tests/test-topic-stack-complex.t	Sat Apr 27 22:59:48 2019 -0400
@@ -146,7 +146,7 @@
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -r .
   ec94a1ed1330 tip
-  $ hg up --hidden 'min(precursors(.))'
+  $ hg up --hidden 'min(predecessors(.))'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   updated to hidden changeset f1d3649d6a8b
   (hidden revision 'f1d3649d6a8b' was rewritten as: ec94a1ed1330)
--- a/tests/test-uncommit.t	Sat Apr 27 22:33:16 2019 -0400
+++ b/tests/test-uncommit.t	Sat Apr 27 22:59:48 2019 -0400
@@ -361,9 +361,9 @@
   b: no such file in rev 5b27f6b17da2
   [1]
 
-Test uncommiting precursors
+Test uncommiting predecessors
 
-  $ hg uncommit --hidden --rev 'precursors(.)' b --traceback
+  $ hg uncommit --hidden --rev 'predecessors(.)' b --traceback
   $ hg cat b --rev .
   b
   b
--- a/tests/test-userguide.t	Sat Apr 27 22:33:16 2019 -0400
+++ b/tests/test-userguide.t	Sat Apr 27 22:59:48 2019 -0400
@@ -122,7 +122,7 @@
   ~
   $ hg --hidden log -q -r 'successors(05e61aab8294) | successors(be6d5bc8e4cc) | successors(35f432d9f7c1)'
   9:171c6a79a27b
-  $ hg --hidden log -q -r 'precursors(171c6a79a27b)'
+  $ hg --hidden log -q -r 'predecessors(171c6a79a27b)'
   6:05e61aab8294
   7:be6d5bc8e4cc
   8:35f432d9f7c1