comparison mercurial/hg.py @ 17867:c9339efed653 stable

clone: make sure to use "@" as bookmark and "default" as branch (issue3677) Before this change a bookmark named "default" or a branch named "@" would cause the wrong changeset to be checked out. The change in output of test-hardlinks.t is due to the fact that no unneeded tag lookups for the tags "@" or "default" happen, therefore the cache file is not created.
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 26 Oct 2012 12:36:15 +0200
parents b32e55e6c3c7
children 7d2dd10ce9ea
comparison
equal deleted inserted replaced
17866:75b43843eb4d 17867:c9339efed653
407 destrepo.ui.setconfig('paths', 'default', defaulturl) 407 destrepo.ui.setconfig('paths', 'default', defaulturl)
408 408
409 if update: 409 if update:
410 if update is not True: 410 if update is not True:
411 checkout = srcpeer.lookup(update) 411 checkout = srcpeer.lookup(update)
412 for test in (checkout, '@', 'default', 'tip'): 412 uprev = None
413 if test is None: 413 if checkout is not None:
414 continue
415 try: 414 try:
416 uprev = destrepo.lookup(test) 415 uprev = destrepo.lookup(checkout)
417 break
418 except error.RepoLookupError: 416 except error.RepoLookupError:
419 continue 417 pass
418 if uprev is None:
419 try:
420 uprev = destrepo._bookmarks['@']
421 except KeyError:
422 try:
423 uprev = destrepo.branchtip('default')
424 except error.RepoLookupError:
425 uprev = destrepo.lookup('tip')
420 bn = destrepo[uprev].branch() 426 bn = destrepo[uprev].branch()
421 destrepo.ui.status(_("updating to branch %s\n") % bn) 427 destrepo.ui.status(_("updating to branch %s\n") % bn)
422 _update(destrepo, uprev) 428 _update(destrepo, uprev)
423 if update in destrepo._bookmarks: 429 if update in destrepo._bookmarks:
424 bookmarks.setcurrent(destrepo, update) 430 bookmarks.setcurrent(destrepo, update)