- # XXX: turn this into a context
- try:
- try:
- os.open(".scripts-migrate-lock", os.O_CREAT | os.O_EXCL)
- except OSError as e:
- if e.errno == errno.EEXIST:
- raise DirectoryLockedError
- elif e.errno == errno.EACCES:
- raise command.PermissionsError(dir)
- raise
- make_repository(sh, options, repo, tag)
- check_variables(deployment, options)
- finally: