Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 28030:ca2a0a654f54
update: warn about other topological head in pull and unbundle
Other commands have a '--update' triggering a bare update. We now issue the
message introduced into the previous changeset for these too.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 03 Feb 2016 15:12:01 +0000 |
parents | 72072cfc7e91 |
children | 8157c6b82f40 |
comparison
equal
deleted
inserted
replaced
28029:72072cfc7e91 | 28030:ca2a0a654f54 |
---|---|
5540 | 5540 |
5541 def postincoming(ui, repo, modheads, optupdate, checkout): | 5541 def postincoming(ui, repo, modheads, optupdate, checkout): |
5542 if modheads == 0: | 5542 if modheads == 0: |
5543 return | 5543 return |
5544 if optupdate: | 5544 if optupdate: |
5545 warndest = False | |
5545 try: | 5546 try: |
5546 brev = checkout | 5547 brev = checkout |
5547 movemarkfrom = None | 5548 movemarkfrom = None |
5548 if not checkout: | 5549 if not checkout: |
5550 warndest = True | |
5549 updata = destutil.destupdate(repo) | 5551 updata = destutil.destupdate(repo) |
5550 checkout, movemarkfrom, brev = updata | 5552 checkout, movemarkfrom, brev = updata |
5551 ret = hg.update(repo, checkout) | 5553 ret = hg.update(repo, checkout) |
5554 if warndest: | |
5555 destutil.statusotherdests(ui, repo) | |
5552 except error.UpdateAbort as inst: | 5556 except error.UpdateAbort as inst: |
5553 msg = _("not updating: %s") % str(inst) | 5557 msg = _("not updating: %s") % str(inst) |
5554 hint = inst.hint | 5558 hint = inst.hint |
5555 raise error.UpdateAbort(msg, hint=hint) | 5559 raise error.UpdateAbort(msg, hint=hint) |
5556 if not ret and movemarkfrom: | 5560 if not ret and movemarkfrom: |