# HG changeset patch # User Pierre-Yves David # Date 1444869344 -3600 # Node ID a271925699d66c340ce76f22663f2ece0aaa024a # Parent 04176eaf911b79c07a79b29bef39f9ded868b4d7 revset: reintroduce and experimental revset for update destination The revset is not ready for prime time yet. However it is useful to have some version of it exposed to help candidate users to play with it and provide feedback on what we should aim at. We add a small test to make sure the code runs. diff -r 04176eaf911b -r a271925699d6 mercurial/revset.py --- a/mercurial/revset.py Wed Oct 14 15:11:53 2015 -0400 +++ b/mercurial/revset.py Thu Oct 15 01:35:44 2015 +0100 @@ -12,6 +12,7 @@ from .i18n import _ from . import ( + destutil, encoding, error, hbisect, @@ -463,6 +464,11 @@ # functions +def _destupdate(repo, subset, x): + # experimental revset for update destination + args = getargsdict(x, 'limit', 'clean check') + return subset & baseset([destutil.destupdate(repo, **args)[0]]) + def _mergedefaultdest(repo, subset, x): # ``_mergedefaultdest()`` @@ -2142,6 +2148,7 @@ return baseset([r for r in ls if r in s]) symbols = { + "_destupdate": _destupdate, "_mergedefaultdest": _mergedefaultdest, "adds": adds, "all": getall, diff -r 04176eaf911b -r a271925699d6 tests/test-update-branches.t --- a/tests/test-update-branches.t Wed Oct 14 15:11:53 2015 -0400 +++ b/tests/test-update-branches.t Thu Oct 15 01:35:44 2015 +0100 @@ -260,3 +260,8 @@ $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889 $ hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test experimental revset support + + $ hg log -r '_destupdate()' + 2:bd10386d478c 2 (no-eol)