[PATCH 12 of 14 evolve-ext] revset: switch internal uses and tests to `predecessors` from legacy name

Matt Harbison mharbison72 at gmail.com
Sun Apr 28 00:28:59 EDT 2019


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1556420388 14400
#      Sat Apr 27 22:59:48 2019 -0400
# Node ID 5e8af05d917815e23977d7ab054d17d8a343e0a5
# Parent  eed04da5b1e569516d8b7d315404f0787ef545f1
revset: switch internal uses and tests to `predecessors` from legacy name

diff --git a/hgext3rd/evolve/__init__.py b/hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py
+++ b/hgext3rd/evolve/__init__.py
@@ -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
diff --git a/hgext3rd/evolve/evolvecmd.py b/hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py
+++ b/hgext3rd/evolve/evolvecmd.py
@@ -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)
 
diff --git a/hgext3rd/evolve/rewind.py b/hgext3rd/evolve/rewind.py
--- a/hgext3rd/evolve/rewind.py
+++ b/hgext3rd/evolve/rewind.py
@@ -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')
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -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
diff --git a/tests/test-rewind.t b/tests/test-rewind.t
--- a/tests/test-rewind.t
+++ b/tests/test-rewind.t
@@ -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
diff --git a/tests/test-sharing.t b/tests/test-sharing.t
--- a/tests/test-sharing.t
+++ b/tests/test-sharing.t
@@ -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
diff --git a/tests/test-topic-stack-complex.t b/tests/test-topic-stack-complex.t
--- a/tests/test-topic-stack-complex.t
+++ b/tests/test-topic-stack-complex.t
@@ -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)
diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -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
diff --git a/tests/test-userguide.t b/tests/test-userguide.t
--- a/tests/test-userguide.t
+++ b/tests/test-userguide.t
@@ -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


More information about the Mercurial-devel mailing list