Patchwork [4,of,4,defaultdest,V2] update: also use 'destupdate' for pull and unbundle

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 12, 2015, 5:22 p.m.
Message ID <7e9c4ed18558ea9e3f98.1444670576@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10965/
State Superseded
Commit 70ac5f724fbdc3b86de8e7d3e854e1045c672f60
Headers show

Comments

Pierre-Yves David - Oct. 12, 2015, 5:22 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 7e9c4ed18558ea9e3f9870d7228a009af3c5c90c
# Parent  330ed5e136273f627695777702a77ab695bc62e2
# EXP-Topic defaultdest
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 7e9c4ed18558
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)