Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 37480:c569e51ee449
clone: avoid using repo.lookup() with binary nodeid
The code in hg.clone() is a bit of a mess, but it seems like the
"checkout" variable is always a binary nodeid (tests pass when run
with "assert len(checkout) == 20" before the
repo.lookup()). repo.lookup() will soon work only with string inputs,
so we need remove this use.
Differential Revision: https://phab.mercurial-scm.org/D3191
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sun, 08 Apr 2018 08:53:43 -0700 |
parents | 70c52800940b |
children | 7c848ab13eff |
comparison
equal
deleted
inserted
replaced
37479:d665b4ea7d4c | 37480:c569e51ee449 |
---|---|
709 if update is not True: | 709 if update is not True: |
710 checkout = srcpeer.lookup(update) | 710 checkout = srcpeer.lookup(update) |
711 uprev = None | 711 uprev = None |
712 status = None | 712 status = None |
713 if checkout is not None: | 713 if checkout is not None: |
714 try: | 714 if checkout in destrepo: |
715 uprev = destrepo.lookup(checkout) | 715 uprev = checkout |
716 except error.RepoLookupError: | 716 else: |
717 if update is not True: | 717 if update is not True: |
718 try: | 718 try: |
719 uprev = destrepo.lookup(update) | 719 uprev = destrepo.lookup(update) |
720 except error.RepoLookupError: | 720 except error.RepoLookupError: |
721 pass | 721 pass |