Skip to content

Commit

Permalink
Extend the interface of ScriptRepository for removing files
Browse files Browse the repository at this point in the history
Add two new methods to ScriptRepository to allow removing files locally
and from the central repository.

re #7031
  • Loading branch information
gesnerpassos committed May 28, 2013
1 parent 9d34d73 commit f0f0901
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,43 @@ They will work as was expected for folders @ref folders-sec.
const std::string & author,
const std::string & email) = 0;

/**
Delete the file from the local folder and from the remote repository.
After this, the file will not be available for anyone among the users. As so,
it is required a justification of why to remove (the comment), and the current
rule accept that only the owner of the file (which is considered the last one
to use the file) is allowed to remove it.
The file must be removed from the central repository (git)
@note This operation requires internet connection.
@param file_path for the file to be deleted. It will not accept deleting folders for
security reason.
@param comment The reson of why deleting this entry.
@param author An string that may identify who is requesting to delete the file.
It accept only the last author to remove it.
@param email An string that identifies the email of the author.
@exception ScriptRepoException may be triggered for an attempt to delete folders,
or a non existent file, or not allowed operation, or any network erros.
*/
virtual void remove(const std::string & file_path, const std::string & comment,
const std::string & author,
const std::string & email) = 0;
/** Delete the file from the local repository only. It does not touch the central repository.
This operation does not require internet connection. Although it is not strictly necessary
to remove files using this method remove_local, because, the ScriptRepository does recognize
files being removed from the folder, it may be used for convenience.
@param file_path for the file to be deleted.
*/
virtual void remove_local(const std::string & file_path) = 0;

/** Define the file patterns that will not be listed in listFiles.
This is important to force the ScriptRepository to not list hidden files,
automatic generated files and so on. This helps to present to the user a
Expand Down

0 comments on commit f0f0901

Please sign in to comment.