Patchwork [2,of,3,V2] merge: get the default update destination from the function

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 8, 2015, 7:09 p.m.
Message ID <d67e4e13b4eab3b81f90.1444331386@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10888/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 8, 2015, 7:09 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1443503483 25200
#      Mon Sep 28 22:11:23 2015 -0700
# Node ID d67e4e13b4eab3b81f90fa58b8e7bcc423e9c543
# Parent  626558e252ef35fab8ccebaad863f08ad3f0839b
merge: get the default update destination from the function

There is no value in using the revset instead of the extracted function.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -19,10 +19,11 @@  from .node import (
     nullid,
     nullrev,
 )
 from . import (
     copies,
+    destutil,
     filemerge,
     obsolete,
     subrepo,
     util,
     worker,
@@ -992,13 +993,11 @@  def update(repo, node, branchmerge, forc
         pas = [None]
         if ancestor is not None:
             pas = [repo[ancestor]]
 
         if node is None:
-            nodes = list(repo.set('_updatedefaultdest()'))
-            if nodes:
-                node = nodes[0].node()
+            node = repo[destutil.destupdate(repo)].node()
 
         overwrite = force and not branchmerge
 
         p2 = repo[node]
         if pas[0] is None: