D250: revset: rename unstable into orphan

lothiraldan (Boris Feld) phabricator at mercurial-scm.org
Mon Aug 7 10:10:53 UTC 2017


lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Don't touch unstable volatile set name, only the revset name. The volatile set
  name will be updated in a later patch.
  
  The renaming is done according to
  https://www.mercurial-scm.org/wiki/CEDVocabulary.

REPOSITORY
  rHG Mercurial

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

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)
+
+ at 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
@@ -4975,11 +4975,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"),
             }



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


More information about the Mercurial-devel mailing list