Patchwork [1,of,2,default-dest] update: "deprecate" call to 'merge.update' without a destination

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 15, 2015, 12:05 a.m.
Message ID <f005ccc592ba7bff1232.1444867539@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/11089/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 15, 2015, 12:05 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1444106529 25200
#      Mon Oct 05 21:42:09 2015 -0700
# Node ID f005ccc592ba7bff1232c2f07061a0909d1d1496
# Parent  07db7e95c464537aeb2dd7aba39de0813eaffd04
# EXP-Topic defaultdest
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r f005ccc592ba
update: "deprecate" call to 'merge.update' without a destination

Now that all internal caller pre-compute and set a destination at a higher level
it feel like we can kill this API. This will allow use to simplify this
function. However I feel like this is a bit too central and critical to break
now. I'm adding a devel warning to let extension make catch this in the next
cycle.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1078,10 +1078,13 @@  def update(repo, node, branchmerge, forc
         pas = [None]
         if ancestor is not None:
             pas = [repo[ancestor]]
 
         if node is None:
+            if (repo.ui.configbool('devel', 'all-warnings')
+                    or repo.ui.configbool('devel', 'oldapi')):
+                repo.ui.develwarn('update with no target')
             rev, _mark, _act = destutil.destupdate(repo)
             node = repo[rev].node()
 
         overwrite = force and not branchmerge