hgext/lfs/__init__.py
changeset 36400 7b86aa31b004
parent 36142 60dd840a7fdb
child 36456 9ff5cbfbc26a
equal deleted inserted replaced
36399:a24c57f1f5c3 36400:7b86aa31b004
   218     repo.__class__ = lfsrepo
   218     repo.__class__ = lfsrepo
   219 
   219 
   220     if 'lfs' not in repo.requirements:
   220     if 'lfs' not in repo.requirements:
   221         def checkrequireslfs(ui, repo, **kwargs):
   221         def checkrequireslfs(ui, repo, **kwargs):
   222             if 'lfs' not in repo.requirements:
   222             if 'lfs' not in repo.requirements:
   223                 last = kwargs.get('node_last')
   223                 last = kwargs.get(r'node_last')
   224                 _bin = node.bin
   224                 _bin = node.bin
   225                 if last:
   225                 if last:
   226                     s = repo.set('%n:%n', _bin(kwargs['node']), _bin(last))
   226                     s = repo.set('%n:%n', _bin(kwargs[r'node']), _bin(last))
   227                 else:
   227                 else:
   228                     s = repo.set('%n', _bin(kwargs['node']))
   228                     s = repo.set('%n', _bin(kwargs[r'node']))
   229             for ctx in s:
   229             for ctx in s:
   230                 # TODO: is there a way to just walk the files in the commit?
   230                 # TODO: is there a way to just walk the files in the commit?
   231                 if any(ctx[f].islfs() for f in ctx.files() if f in ctx):
   231                 if any(ctx[f].islfs() for f in ctx.files() if f in ctx):
   232                     repo.requirements.add('lfs')
   232                     repo.requirements.add('lfs')
   233                     repo._writerequirements()
   233                     repo._writerequirements()