GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/publish/cmd_transaction.h
Date: 2026-08-30 02:40:36
Exec Total Coverage
Lines: 0 21 0.0%
Branches: 0 68 0.0%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #ifndef CVMFS_PUBLISH_CMD_TRANSACTION_H_
6 #define CVMFS_PUBLISH_CMD_TRANSACTION_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "publish/command.h"
12
13 namespace publish {
14
15 class CmdTransaction : public Command {
16 public:
17 virtual std::string GetName() const { return "transaction"; }
18 virtual std::string GetBrief() const {
19 return "Open a managed repository for writing";
20 }
21 virtual std::string GetDescription() const {
22 return "A transaction gets a lease for a repository in order to write "
23 "new content. The content is not visible to clients until "
24 "publication. "
25 "Transactions can be aborted in order to revert to the original "
26 "state. "
27 "Repositories that are configured to use a CernVM-FS gateway can "
28 "lock "
29 "certain sub paths, such that other publisher nodes can publish "
30 "concurrently to other sub trees.";
31 }
32 virtual std::string GetUsage() const {
33 return "[options] <repository name>[path]";
34 }
35 virtual std::vector<std::string> DoGetExamples() const {
36 std::vector<std::string> e;
37 e.push_back("example.cvmfs.io "
38 "# normal use with a locally managed repository");
39 e.push_back("example.cvmfs.io/64bit/v42 "
40 "# locks only the given sub tree, use with gateway "
41 "(no space between the repository name and the path)");
42 e.push_back("example.cvmfs.io/popular/path -t 500 "
43 "# retries for a maximum of 5 minutes to lock /popular/path");
44 return e;
45 }
46 virtual ParameterList GetParams() const {
47 ParameterList p;
48 p.push_back(Parameter::Optional(
49 "retry-timeout", 't', "seconds",
50 "Retry for a maximum number of given seconds if repository is busy "
51 "(0 for infinite)"));
52 p.push_back(Parameter::Optional(
53 "template", 'T', "from-dir=to-dir",
54 "Clone directory 'from-dir' to 'to-dir' as part of opening the "
55 "transaction"));
56 p.push_back(Parameter::Optional(
57 "template-from", 'U', "from-dir",
58 "Use -U and -V as an alternative to the -T parameter"));
59 p.push_back(Parameter::Optional(
60 "template-to", 'V', "to-dir",
61 "Use -U and -V as an alternative to the -T parameter"));
62 p.push_back(Parameter::Switch(
63 "allow-nonexistent-path", 'P',
64 "Allow opening a transaction on a lease path whose parent directory "
65 "does not exist yet (gateway publishing only; requires a gateway that "
66 "supports it)"));
67 return p;
68 }
69
70 virtual int Main(const Options &options);
71 }; // class CmdTransaction
72
73 } // namespace publish
74
75 #endif // CVMFS_PUBLISH_CMD_TRANSACTION_H_
76