Skip to content

Instantly share code, notes, and snippets.

@jborg
Created June 6, 2014 12:07
Show Gist options
  • Save jborg/d5bd7ceb419becdbc8f0 to your computer and use it in GitHub Desktop.
Save jborg/d5bd7ceb419becdbc8f0 to your computer and use it in GitHub Desktop.
import sys
from attic.remote import RemoteRepository
from attic.repository import Repository
from attic.helpers import Location, Manifest, unhexlify
if __name__ == '__main__':
location = Location(sys.argv[1])
if location.proto == 'ssh':
repository = RemoteRepository(location)
else:
repository = Repository(location.path)
manifest, key = Manifest.load(repository)
for key in sys.argv[2:]:
print('Deleting', key)
repository.delete(unhexlify(key))
repository.commit()
print('Done')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment