<s> """<STR_LIT>""" <EOL> __docformat__ = '<STR_LIT>' <EOL> from glob import glob <EOL> from . base import Interface <EOL> from . . support . param import Parameter <EOL> from . . support . constraints import EnsureStr <EOL> from . . support . annexrepo import AnnexRepo <EOL> from . . cmdline . helpers import get_repo_instance <EOL> from logging import getLogger <EOL> lgr = getLogger ( '<STR_LIT>' ) <EOL> class Drop ( Interface ) : <EOL> """<STR_LIT>""" <EOL> _params_ = dict ( <EOL> paths = Parameter ( <EOL> doc = "<STR_LIT>" , <EOL> constraints = EnsureStr ( ) , <EOL> metavar = '<STR_LIT:file>' , <EOL> nargs = '<STR_LIT:+>' ) ) <EOL> def __call__ ( self , paths ) : <EOL> handle = get_repo_instance ( class_ = AnnexRepo ) <EOL> expanded_list = [ ] <EOL> [ expanded_list . extend ( glob ( item ) ) for item in paths ] <EOL> annex_branches = [ b for b in handle . repo . branches if b . name == '<STR_LIT>' ] <EOL> if not len ( annex_branches ) == <NUM_LIT:1> : <EOL> raise RuntimeError ( "<STR_LIT>" % handle . path ) <EOL> annex_branch = annex_branches [ <NUM_LIT:0> ] <EOL> old_hexsha = annex_branch . object . hexsha <EOL> try : <EOL> handle . annex_drop ( expanded_list ) <EOL> finally : <EOL> changed = [ d . a_path for d in annex_branch . commit . diff ( old_hexsha ) <EOL> if d . a_path . endswith ( '<STR_LIT>' ) ] <EOL> lgr . info ( "<STR_LIT>" % ( len ( changed ) ) ) </s>
