# HG changeset patch # User Matt Mackall # Date 1317332928 18000 # Node ID aa262fff87ac028affbe72d3a47d0cb31d07710b # Parent cfccd3bee7b3e8d03525f5f60ca248a45b31fb21 largefile: fix up hasattr usage diff -r cfccd3bee7b3 -r aa262fff87ac hgext/largefiles/basestore.py --- a/hgext/largefiles/basestore.py Sat Sep 24 17:35:45 2011 +0200 +++ b/hgext/largefiles/basestore.py Thu Sep 29 16:48:48 2011 -0500 @@ -179,7 +179,7 @@ # The path could be a scheme so use Mercurial's normal functionality # to resolve the scheme to a repository and use its path - path = hasattr(remote, 'url') and remote.url() or remote.path + path = util.safehasattr(remote, 'url') and remote.url() or remote.path match = _scheme_re.match(path) if not match: # regular filesystem path diff -r cfccd3bee7b3 -r aa262fff87ac hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py Sat Sep 24 17:35:45 2011 +0200 +++ b/hgext/largefiles/lfutil.py Thu Sep 29 16:48:48 2011 -0500 @@ -170,7 +170,7 @@ except ImportError: # Mercurial <= 1.8 opener = util.opener(admin) - if hasattr(repo.dirstate, '_validate'): + if util.safehasattr(repo.dirstate, '_validate'): lfdirstate = largefiles_dirstate(opener, ui, repo.root, repo.dirstate._validate) else: diff -r cfccd3bee7b3 -r aa262fff87ac hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Sat Sep 24 17:35:45 2011 +0200 +++ b/hgext/largefiles/overrides.py Thu Sep 29 16:48:48 2011 -0500 @@ -483,7 +483,7 @@ oldmatch = None # for the closure def override_match(ctxorrepo, pats=[], opts={}, globbed=False, default='relpath'): - if hasattr(ctxorrepo, 'match'): + if util.safehasattr(ctxorrepo, 'match'): ctx0 = ctxorrepo else: ctx0 = ctxorrepo[None] diff -r cfccd3bee7b3 -r aa262fff87ac hgext/largefiles/uisetup.py --- a/hgext/largefiles/uisetup.py Sat Sep 24 17:35:45 2011 +0200 +++ b/hgext/largefiles/uisetup.py Thu Sep 29 16:48:48 2011 -0500 @@ -69,7 +69,7 @@ extensions.wrapfunction(hg, 'merge', overrides.hg_merge) extensions.wrapfunction(archival, 'archive', overrides.override_archive) - if hasattr(cmdutil, 'bailifchanged'): + if util.safehasattr(cmdutil, 'bailifchanged'): extensions.wrapfunction(cmdutil, 'bailifchanged', overrides.override_bailifchanged) else: