Mercurial > hg
comparison hgext/largefiles/overrides.py @ 15169:aa262fff87ac
largefile: fix up hasattr usage
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 29 Sep 2011 16:48:48 -0500 |
parents | cfccd3bee7b3 |
children | c1a4a3220711 |
comparison
equal
deleted
inserted
replaced
15168:cfccd3bee7b3 | 15169:aa262fff87ac |
---|---|
481 try: | 481 try: |
482 ctx = repo[opts.get('rev')] | 482 ctx = repo[opts.get('rev')] |
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] |
490 match = oldmatch(ctxorrepo, pats, opts, globbed, default) | 490 match = oldmatch(ctxorrepo, pats, opts, globbed, default) |
491 m = copy.copy(match) | 491 m = copy.copy(match) |