##// END OF EJS Templates
largefile: fix up hasattr usage
Matt Mackall -
r15169:aa262fff default
parent child Browse files
Show More
@@ -179,7 +179,7 b' def _openstore(repo, remote=None, put=Fa'
179
179
180 # The path could be a scheme so use Mercurial's normal functionality
180 # The path could be a scheme so use Mercurial's normal functionality
181 # to resolve the scheme to a repository and use its path
181 # to resolve the scheme to a repository and use its path
182 path = hasattr(remote, 'url') and remote.url() or remote.path
182 path = util.safehasattr(remote, 'url') and remote.url() or remote.path
183
183
184 match = _scheme_re.match(path)
184 match = _scheme_re.match(path)
185 if not match: # regular filesystem path
185 if not match: # regular filesystem path
@@ -170,7 +170,7 b' def openlfdirstate(ui, repo):'
170 except ImportError:
170 except ImportError:
171 # Mercurial <= 1.8
171 # Mercurial <= 1.8
172 opener = util.opener(admin)
172 opener = util.opener(admin)
173 if hasattr(repo.dirstate, '_validate'):
173 if util.safehasattr(repo.dirstate, '_validate'):
174 lfdirstate = largefiles_dirstate(opener, ui, repo.root,
174 lfdirstate = largefiles_dirstate(opener, ui, repo.root,
175 repo.dirstate._validate)
175 repo.dirstate._validate)
176 else:
176 else:
@@ -483,7 +483,7 b' def override_revert(orig, ui, repo, *pat'
483 oldmatch = None # for the closure
483 oldmatch = None # for the closure
484 def override_match(ctxorrepo, pats=[], opts={}, globbed=False,
484 def override_match(ctxorrepo, pats=[], opts={}, globbed=False,
485 default='relpath'):
485 default='relpath'):
486 if hasattr(ctxorrepo, 'match'):
486 if util.safehasattr(ctxorrepo, 'match'):
487 ctx0 = ctxorrepo
487 ctx0 = ctxorrepo
488 else:
488 else:
489 ctx0 = ctxorrepo[None]
489 ctx0 = ctxorrepo[None]
@@ -69,7 +69,7 b' def uisetup(ui):'
69 extensions.wrapfunction(hg, 'merge', overrides.hg_merge)
69 extensions.wrapfunction(hg, 'merge', overrides.hg_merge)
70
70
71 extensions.wrapfunction(archival, 'archive', overrides.override_archive)
71 extensions.wrapfunction(archival, 'archive', overrides.override_archive)
72 if hasattr(cmdutil, 'bailifchanged'):
72 if util.safehasattr(cmdutil, 'bailifchanged'):
73 extensions.wrapfunction(cmdutil, 'bailifchanged',
73 extensions.wrapfunction(cmdutil, 'bailifchanged',
74 overrides.override_bailifchanged)
74 overrides.override_bailifchanged)
75 else:
75 else:
General Comments 0
You need to be logged in to leave comments. Login now