Skip to content

Commit

Permalink
Merge pull request #6783 from mih/rf-remove
Browse files Browse the repository at this point in the history
Remove superfluous `AnnexRepo.remove()` implementation
  • Loading branch information
yarikoptic committed Jul 2, 2022
2 parents 05e6cfa + a36c33c commit 3303909
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
18 changes: 0 additions & 18 deletions datalad/support/annexrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2683,24 +2683,6 @@ def precommit(self):
self._batched.close()
super(AnnexRepo, self).precommit()


@normalize_paths(match_return_type=False)
def remove(self, files, force=False, **kwargs):
"""Remove files from git/annex
Parameters
----------
files
force: bool, optional
"""

# TODO: parameter 'force' unnecessary => kwargs / to_options
self.precommit() # since might interfere

return super(AnnexRepo, self).remove(files, force=force,
normalize_paths=False,
**kwargs)

def get_contentlocation(self, key, batch=False):
"""Get location of the key content
Expand Down
6 changes: 6 additions & 0 deletions datalad/support/gitrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,12 @@ def remove(self, files, recursive=False, **kwargs):
if recursive:
kwargs['r'] = True

# the name is chosen badly, but the purpose is to make sure that
# any pending operations actually manifest themselves in the Git repo
# on disk (in case of an AnnexRepo, it could be pending batch
# processes that need closing)
self.precommit()

# output per removed file is expected to be "rm 'PATH'":
return [
line.strip()[4:-1]
Expand Down

0 comments on commit 3303909

Please sign in to comment.