Patchwork D250: revset: rename unstable into orphan

login
register
mail settings
Submitter phabricator
Date Aug. 11, 2017, 8:04 p.m.
Message ID <c97d2467ec520bf6dd199681c33ca9ae@localhost.localdomain>
Download mbox | patch
Permalink /patch/22902/
State Not Applicable
Headers show

Comments

phabricator - Aug. 11, 2017, 8:04 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9dcc3529e002: revset: rename unstable into orphan (authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D250?vs=595&id=804

REVISION DETAIL
  https://phab.mercurial-scm.org/D250

AFFECTED FILES
  mercurial/commands.py
  mercurial/revset.py
  tests/test-commit-amend.t
  tests/test-histedit-obsolete.t
  tests/test-obsolete.t

CHANGE DETAILS




To: lothiraldan, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -527,7 +527,7 @@ 
   update: 1 new changesets, 2 branch heads (merge)
   phases: 3 draft
   orphan: 1 changesets
-  $ hg log -G -r '::unstable()'
+  $ hg log -G -r '::orphan()'
   @  5:cda648ca50f5 (draft orphan) [tip ] add original_e
   |
   x  4:94b33453f93b (draft *obsolete*) [ ] add original_d
@@ -910,7 +910,7 @@ 
   $ hg debugobsolete `getid obsolete_e`
   obsoleted 1 changesets
   $ hg debugobsolete `getid original_c` `getid babar`
-  $ hg log --config ui.logtemplate= -r 'bumped() and unstable()'
+  $ hg log --config ui.logtemplate= -r 'bumped() and orphan()'
   changeset:   7:50c51b361e60
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -925,7 +925,7 @@ 
 
 test the "troubles" templatekw
 
-  $ hg log -r 'bumped() and unstable()'
+  $ hg log -r 'bumped() and orphan()'
   7:50c51b361e60 (draft orphan phase-divergent) [ ] add babar
 
 test the default cmdline template
@@ -947,7 +947,7 @@ 
 
 test summary output
 
-  $ hg up -r 'bumped() and unstable()'
+  $ hg up -r 'bumped() and orphan()'
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg summary
   parent: 7:50c51b361e60  (orphan, phase-divergent)
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -223,12 +223,12 @@ 
   $ echo c >> c
   $ hg histedit --continue
 
-  $ hg log -r 'unstable()'
+  $ hg log -r 'orphan()'
   11:c13eb81022ca f (no-eol)
 
 stabilise
 
-  $ hg rebase  -r 'unstable()' -d .
+  $ hg rebase  -r 'orphan()' -d .
   rebasing 11:c13eb81022ca "f"
   $ hg up tip -q
 
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -604,7 +604,7 @@ 
     babar
   
   $ hg commit --amend
-  $ hg log -r 'unstable()'
+  $ hg log -r 'orphan()'
   changeset:   18:b99e5df575f7
   branch:      a
   parent:      11:3334b7925910
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1919,10 +1919,18 @@ 
 
 @predicate('unstable()', safe=True)
 def unstable(repo, subset, x):
+    msg = ("'unstable()' is deprecated, "
+           "use 'orphan()'")
+    repo.ui.deprecwarn(msg, '4.4')
+
+    return orphan(repo, subset, x)
+
+@predicate('orphan()', safe=True)
+def orphan(repo, subset, x):
     """Non-obsolete changesets with obsolete ancestors.
     """
-    # i18n: "unstable" is a keyword
-    getargs(x, 0, 0, _("unstable takes no arguments"))
+    # i18n: "orphan" is a keyword
+    getargs(x, 0, 0, _("orphan takes no arguments"))
     unstables = obsmod.getrevs(repo, 'unstable')
     return subset & unstables
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4992,11 +4992,11 @@ 
         ui.status(_('phases: %s\n') % ', '.join(t))
 
     if obsolete.isenabled(repo, obsolete.createmarkersopt):
-        for trouble in ("unstable", "divergent", "bumped"):
+        for trouble in ("orphan", "divergent", "bumped"):
             numtrouble = len(repo.revs(trouble + "()"))
             # We write all the possibilities to ease translation
             troublemsg = {
-               "unstable": _("orphan: %d changesets"),
+               "orphan": _("orphan: %d changesets"),
                "divergent": _("content-divergent: %d changesets"),
                "bumped": _("phase-divergent: %d changesets"),
             }