Mercurial > hg > mercurial-source
changeset 9423:1444a42f6052
Make distinct lookup error for localrepo.lookup
This allows clone/share to correctly distinguish lookup errors from
corruption errors and catch only the former.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 31 Aug 2009 10:58:33 -0500 (2009-08-31) |
parents | 3738c8cff1bf |
children | 799373ff2554 744cb8e93936 |
files | mercurial/error.py mercurial/hg.py mercurial/localrepo.py |
diffstat | 3 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/error.py +++ b/mercurial/error.py @@ -36,6 +36,9 @@ class RepoError(Exception): pass +class RepoLookupError(RepoError): + pass + class CapabilityError(RepoError): pass
--- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -137,10 +137,12 @@ if update is not True: checkout = update for test in (checkout, 'default', 'tip'): + if test is None: + continue try: uprev = r.lookup(test) break - except LookupError: + except error.RepoLookupError: continue _update(r, uprev) @@ -309,10 +311,12 @@ if update is not True: checkout = update for test in (checkout, 'default', 'tip'): + if test is None: + continue try: uprev = dest_repo.lookup(test) break - except: + except error.RepoLookupError: continue _update(dest_repo, uprev)