changeset 26716:c027641f8a83

revset: rename and test '_destmerge' We make the name consistent with the one used by '_destupdate' and we ensure the code is run by testing it (abort is expected and merge would).
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 15 Oct 2015 01:47:28 +0100
parents 652dfb1eff14
children 1755e1d9d1c3
files mercurial/revset.py tests/test-merge-default.t
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Oct 15 01:19:32 2015 +0100
+++ b/mercurial/revset.py	Thu Oct 15 01:47:28 2015 +0100
@@ -469,13 +469,8 @@
     args = getargsdict(x, 'limit', 'clean check')
     return subset & baseset([destutil.destupdate(repo, **args)[0]])
 
-def _mergedefaultdest(repo, subset, x):
-    # ``_mergedefaultdest()``
-
-    # default destination for merge.
-    # # 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.
+def _destmerge(repo, subset, x):
+    # experimental revset for merge destination
     getargs(x, 0, 0, _("_mergedefaultdest takes no arguments"))
     return subset & baseset([destutil.destmerge(repo)])
 
@@ -2098,7 +2093,7 @@
 
 symbols = {
     "_destupdate": _destupdate,
-    "_mergedefaultdest": _mergedefaultdest,
+    "_destmerge": _destmerge,
     "adds": adds,
     "all": getall,
     "ancestor": ancestor,
--- a/tests/test-merge-default.t	Thu Oct 15 01:19:32 2015 +0100
+++ b/tests/test-merge-default.t	Thu Oct 15 01:47:28 2015 +0100
@@ -108,3 +108,10 @@
   5:a431fabd6039
   6:e88e33f3bf62
 
+Test experimental destination revset
+
+  $ hg log -r '_destmerge()'
+  abort: branch 'foobranch' has one head - please merge with an explicit rev
+  (run 'hg heads' to see all heads)
+  [255]
+