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

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 8, 2015, 9:42 p.m.
Message ID <e0ad576d2203108c5984.1444340538@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10896/
State Superseded
Commit 70ac5f724fbdc3b86de8e7d3e854e1045c672f60
Headers show

Comments

Pierre-Yves David - Oct. 8, 2015, 9:42 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 e0ad576d2203108c5984f5fd476cca7c7f8f81dc
# Parent  725812283ac94ac10c38ba1112b0857191a1f621
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
@@ -5173,12 +5173,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 util.Abort as inst:
             ui.warn(_("not updating: %s\n") % str(inst))
             if inst.hint:
                 ui.warn(_("(%s)\n") % inst.hint)