Lines Matching +full:commit +full:- +full:message

13  * Checkout and commit pages from the command line while maintaining the history
29 $options->registerOption(
34 $options->registerOption(
40 $options->setHelp(
46 $options->registerCommand(
54 $options->registerArgument(
60 $options->registerArgument(
67 /* commit command */
68 $options->registerCommand(
69 'commit',
73 $options->registerArgument(
75 'The local file to commit',
77 'commit'
79 $options->registerArgument(
83 'commit'
85 $options->registerOption(
86 'message',
90 'commit'
92 $options->registerOption(
97 'commit'
101 $options->registerCommand(
105 $options->registerArgument(
113 $options->registerCommand(
117 $options->registerArgument(
125 $options->registerCommand(
129 $options->registerArgument(
135 $options->registerArgument(
139 'For retrieving items that are stored in sub-arrays, separate the ' .
156 $this->force = $options->getOpt('force', false);
157 $this->username = $options->getOpt('user', $this->getUser());
159 $command = $options->getCmd();
160 $args = $options->getArgs();
165 $this->commandCheckout($wiki_id, $localfile);
167 case 'commit':
170 $this->commandCommit(
173 $options->getOpt('message', ''),
174 $options->getOpt('trivial', false)
179 $this->obtainLock($wiki_id);
180 $this->success("$wiki_id locked");
184 $this->clearLock($wiki_id);
185 $this->success("$wiki_id unlocked");
195 echo $options->help();
213 $this->fatal("$wiki_id does not yet exist");
221 $this->fatal("Working file $localfile cannot be a directory");
225 $this->fatal("Directory " . dirname($localfile) . " does not exist");
229 $this->fatal("Attempt to check out file into data directory - not allowed");
232 $this->obtainLock($wiki_id);
235 $this->clearLock($wiki_id);
236 $this->fatal("Unable to copy $wiki_fn to $localfile");
239 $this->success("$wiki_id > $localfile");
247 * @param string $message
250 protected function commandCommit($localfile, $wiki_id, $message, $minor) argument
253 $message = trim($message);
256 $this->fatal("$localfile does not exist");
260 $this->fatal("Cannot read from $localfile");
263 if (!$message) {
264 $this->fatal("Summary message required");
267 $this->obtainLock($wiki_id);
269 saveWikiText($wiki_id, file_get_contents($localfile), $message, $minor);
271 $this->clearLock($wiki_id);
273 $this->success("$localfile > $wiki_id");
283 if ($this->force) $this->deleteLock($wiki_id);
285 $_SERVER['REMOTE_USER'] = $this->username;
288 $this->error("Page $wiki_id is already locked by another user");
295 $this->error("Unable to obtain lock for $wiki_id ");
308 if ($this->force) $this->deleteLock($wiki_id);
310 $_SERVER['REMOTE_USER'] = $this->username;
312 $this->error("Page $wiki_id is locked by another user");
319 $this->error("Unable to clear lock for $wiki_id");
335 $this->error("Unable to delete $wikiLockFN");
363 $cli->run();