Patchwork [2,of,2,V3] update: also use 'destupdate' for pull and unbundle

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 13, 2015, 6:52 p.m.
Message ID <600dcd6eaf5368a4cb4f.1444762335@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/11019/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 13, 2015, 6:52 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1444105892 25200
#      Mon Oct 05 21:31:32 2015 -0700
# Node ID 600dcd6eaf5368a4cb4fac55dbd0551cde8b8095
# Parent  88139d0257c74a16335585380e0f873efcdffbed
# EXP-Topic defaultdest
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 600dcd6eaf53
update: also use 'destupdate' for pull and unbundle

Update can also be performed by 'hg pull --update' and 'hg unbundle'. We use the
destupdate function in these case too.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5177,12 +5177,16 @@  def phase(ui, repo, *revs, **opts):
 
 def postincoming(ui, repo, modheads, optupdate, checkout):
     if modheads == 0:
         return
     if optupdate:
-        checkout, movemarkfrom = bookmarks.calculateupdate(ui, repo, checkout)
         try:
+            brev = checkout
+            movemarkfrom = None
+            if not checkout:
+                updata =  destutil.destupdate(repo)
+                checkout, movemarkfrom, brev = updata
             ret = hg.update(repo, checkout)
         except error.Abort as inst:
             ui.warn(_("not updating: %s\n") % str(inst))
             if inst.hint:
                 ui.warn(_("(%s)\n") % inst.hint)