hgext/largefiles/overrides.py
changeset 35887 572f36e9a780
parent 35885 7625b4f7db70
child 36002 f8ad57d24252
equal deleted inserted replaced
35886:b0014780c7fc 35887:572f36e9a780
   387     # For hg log --patch, the match object is used in two different senses:
   387     # For hg log --patch, the match object is used in two different senses:
   388     # (1) to determine what revisions should be printed out, and
   388     # (1) to determine what revisions should be printed out, and
   389     # (2) to determine what files to print out diffs for.
   389     # (2) to determine what files to print out diffs for.
   390     # The magic matchandpats override should be used for case (1) but not for
   390     # The magic matchandpats override should be used for case (1) but not for
   391     # case (2).
   391     # case (2).
   392     def overridemakelogfilematcher(repo, pats, opts, badfn=None):
   392     def overridemakefilematcher(repo, pats, opts, badfn=None):
   393         wctx = repo[None]
   393         wctx = repo[None]
   394         match, pats = oldmatchandpats(wctx, pats, opts, badfn=badfn)
   394         match, pats = oldmatchandpats(wctx, pats, opts, badfn=badfn)
   395         return lambda rev: match
   395         return lambda rev: match
   396 
   396 
   397     oldmatchandpats = installmatchandpatsfn(overridematchandpats)
   397     oldmatchandpats = installmatchandpatsfn(overridematchandpats)
   398     oldmakelogfilematcher = logcmdutil._makenofollowlogfilematcher
   398     oldmakefilematcher = logcmdutil._makenofollowfilematcher
   399     setattr(logcmdutil, '_makenofollowlogfilematcher',
   399     setattr(logcmdutil, '_makenofollowfilematcher', overridemakefilematcher)
   400             overridemakelogfilematcher)
       
   401 
   400 
   402     try:
   401     try:
   403         return orig(ui, repo, *pats, **opts)
   402         return orig(ui, repo, *pats, **opts)
   404     finally:
   403     finally:
   405         restorematchandpatsfn()
   404         restorematchandpatsfn()
   406         setattr(logcmdutil, '_makenofollowlogfilematcher',
   405         setattr(logcmdutil, '_makenofollowfilematcher', oldmakefilematcher)
   407                 oldmakelogfilematcher)
       
   408 
   406 
   409 def overrideverify(orig, ui, repo, *pats, **opts):
   407 def overrideverify(orig, ui, repo, *pats, **opts):
   410     large = opts.pop(r'large', False)
   408     large = opts.pop(r'large', False)
   411     all = opts.pop(r'lfa', False)
   409     all = opts.pop(r'lfa', False)
   412     contents = opts.pop(r'lfc', False)
   410     contents = opts.pop(r'lfc', False)