Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 26642:70ac5f724fbd
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.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 05 Oct 2015 21:31:32 -0700 |
parents | 5c57d01fe64e |
children | c502be14b4e2 |
comparison
equal
deleted
inserted
replaced
26641:5c57d01fe64e | 26642:70ac5f724fbd |
---|---|
5183 | 5183 |
5184 def postincoming(ui, repo, modheads, optupdate, checkout): | 5184 def postincoming(ui, repo, modheads, optupdate, checkout): |
5185 if modheads == 0: | 5185 if modheads == 0: |
5186 return | 5186 return |
5187 if optupdate: | 5187 if optupdate: |
5188 checkout, movemarkfrom = bookmarks.calculateupdate(ui, repo, checkout) | |
5189 try: | 5188 try: |
5189 brev = checkout | |
5190 movemarkfrom = None | |
5191 if not checkout: | |
5192 updata = destutil.destupdate(repo) | |
5193 checkout, movemarkfrom, brev = updata | |
5190 ret = hg.update(repo, checkout) | 5194 ret = hg.update(repo, checkout) |
5191 except error.Abort as inst: | 5195 except error.Abort as inst: |
5192 ui.warn(_("not updating: %s\n") % str(inst)) | 5196 ui.warn(_("not updating: %s\n") % str(inst)) |
5193 if inst.hint: | 5197 if inst.hint: |
5194 ui.warn(_("(%s)\n") % inst.hint) | 5198 ui.warn(_("(%s)\n") % inst.hint) |