5 #ifndef CVMFS_SWISSKNIFE_HISTORY_H_
6 #define CVMFS_SWISSKNIFE_HISTORY_H_
22 class WritableCatalog;
26 struct SpoolerDefinition;
31 namespace swissknife {
33 class CommandTag :
public Command {
43 typedef std::vector<history::History::Tag>
TagList;
44 typedef std::vector<history::History::Branch>
BranchList;
49 repository_url(repository_url), tmp_path(tmp_path) {}
64 const bool read_write);
73 const bool undo_rollback =
false);
78 const std::string &destination_path)
const;
80 const std::string &repository_url,
81 const std::string &history_path,
82 const bool read_write)
const;
86 const std::string catalog_path,
87 const bool read_write)
const;
93 const bool align_right =
false,
94 const std::string &fill_char =
" ")
const;
109 virtual std::string
GetName()
const {
return "tag_edit"; }
111 return "Create a tag and/or remove tags.";
122 const std::string &root_hash_string)
const;
125 const bool user_provided_hash);
138 virtual std::string
GetName()
const {
return "tag_list"; }
140 return "List tags in the tag database.";
157 const std::string &parent_branch,
174 virtual std::string
GetName()
const {
return "tag_info"; }
176 return "Obtain detailed information about a tag.";
193 virtual std::string
GetName()
const {
return "tag_rollback"; }
195 return "Rollback repository to a given tag.";
211 virtual std::string
GetName()
const {
return "tag_empty_bin"; }
213 return "Empty the internal recycle bin of the history database.";
222 #endif // CVMFS_SWISSKNIFE_HISTORY_H_
virtual std::string GetDescription() const
virtual ParameterList GetParams() const
const manifest::Manifest * manifest() const
virtual std::string GetName() const
const std::string repository_url
bool CloseAndPublishHistory(Environment *environment)
bool UpdateUndoTags(Environment *env, const history::History::Tag ¤t_head_template, const bool undo_rollback=false)
static const std::string kPreviousHeadTag
std::vector< Parameter > ParameterList
UniquePtr< manifest::Manifest > manifest
int Main(const ArgumentList &args)
std::string HumanReadableFilesize(const size_t filesize) const
virtual std::string GetDescription() const
int Main(const ArgumentList &args)
virtual ParameterList GetParams() const
bool MoveTag(Environment *env, const history::History::Tag &tag_template)
Environment(const std::string &repository_url, const std::string &tmp_path)
static const std::string kHeadTagDescription
void PrintTagMachineReadable(const history::History::Tag &tag) const
std::string AddPadding(const std::string &str, const size_t padding, const bool align_right=false, const std::string &fill_char=" ") const
std::vector< history::History::Tag > TagList
virtual ParameterList GetParams() const
bool UploadCatalogAndUpdateManifest(Environment *env, catalog::WritableCatalog *catalog)
int Main(const ArgumentList &args)
std::vector< history::History::Branch > BranchList
virtual std::string GetName() const
history::History * GetHistory(const manifest::Manifest *manifest, const std::string &repository_url, const std::string &history_path, const bool read_write) const
bool IsUndoTagName(const std::string &tag_name) const
static const std::string kPreviousHeadTagDescription
virtual std::string GetName() const
int AddNewTag(const ArgumentList &args, Environment *env)
bool FetchObject(const std::string &repository_url, const shash::Any &object_hash, const std::string &destination_path) const
void PrintHumanReadableInfo(const history::History::Tag &tag) const
const std::string tmp_path
bool CreateTag(Environment *env, const history::History::Tag &new_tag)
static const std::string kHeadTag
void PrintDeletedTagList(const TagList &tags) const
virtual std::string GetName() const
bool ManipulateTag(Environment *env, const history::History::Tag &tag_template, const bool user_provided_hash)
virtual std::string GetDescription() const
catalog::Catalog * GetCatalog(const std::string &repository_url, const shash::Any &catalog_hash, const std::string catalog_path, const bool read_write) const
int Main(const ArgumentList &args)
void UploadClosure(const upload::SpoolerResult &result, Future< shash::Any > *hash)
std::map< char, SharedPtr< std::string > > ArgumentList
virtual ParameterList GetParams() const
UniquePtr< history::History > history
UnlinkGuard manifest_path
Environment * InitializeEnvironment(const ArgumentList &args, const bool read_write)
int RemoveTags(const ArgumentList &args, Environment *env)
UniquePtr< manifest::Manifest > previous_manifest
shash::Any GetTagRootHash(Environment *env, const std::string &root_hash_string) const
UniquePtr< upload::Spooler > spooler
virtual std::string GetDescription() const