mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Merge branch '1.9.3' of tasktools.org:task into 1.9.3
This commit is contained in:
commit
bb6f456e04
3 changed files with 60 additions and 39 deletions
|
@ -259,11 +259,11 @@ This time the URI is determined automatically, and after the merge the files are
|
||||||
pushed back to the remote machine. In a similar way, the remote machine can
|
pushed back to the remote machine. In a similar way, the remote machine can
|
||||||
also be configured to merge from the local machine and push back to it. Then it
|
also be configured to merge from the local machine and push back to it. Then it
|
||||||
is just a matter of Alice remembering to merge now and then, from either
|
is just a matter of Alice remembering to merge now and then, from either
|
||||||
machine, to have her data in two places.
|
machine, to have her data in two (or even more) places.
|
||||||
|
|
||||||
.SH CONFIGURATION
|
.SH CONFIGURATION
|
||||||
By setting these configuration variables, it is possible to simplify the
|
By setting these configuration variables, it is possible to simplify the
|
||||||
synchronization commands, by relying on the defaults.
|
synchronization commands, by relying on the defaults or alias names.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
.B merge.autopush=yes|no|ask
|
.B merge.autopush=yes|no|ask
|
||||||
|
@ -276,23 +276,29 @@ performed, or whether the user is asked every time. The default value is 'ask'.
|
||||||
.B merge.default.uri=<uri>
|
.B merge.default.uri=<uri>
|
||||||
.RS
|
.RS
|
||||||
Sets a default URI so that just the 'task merge' command be run without the
|
Sets a default URI so that just the 'task merge' command be run without the
|
||||||
need to retype the URI every time.
|
need to retype the URI every time. You can also use this configuration scheme
|
||||||
|
to set alias names, e.g. set merge.desktop.uri and run 'task merge desktop'.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
.br
|
.br
|
||||||
.B push.default.uri=<uri>
|
.B push.default.uri=<uri>
|
||||||
.RS
|
.RS
|
||||||
Sets a default URI so that just the 'task push' command be run without the
|
Sets a default URI so that just the 'task push' command be run without the
|
||||||
need to retype the URI every time.
|
need to retype the URI every time. You can also use this configuration scheme
|
||||||
|
to set alias names, e.g. set push.desktop.uri and run 'task push desktop'.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
.br
|
.br
|
||||||
.B pull.default.uri=<uri>
|
.B pull.default.uri=<uri>
|
||||||
.RS
|
.RS
|
||||||
Sets a default URI so that just the 'task pull' command be run without the
|
Sets a default URI so that just the 'task pull' command be run without the
|
||||||
need to retype the URI every time.
|
need to retype the URI every time. You can also use this configuration scheme
|
||||||
|
to set alias names, e.g. set pull.desktop.uri and run 'task pull desktop'.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
Note that, when using SSH/scp, hostnames will be expanded due to the ssh
|
||||||
|
configuration file ~/.ssh/config.
|
||||||
|
|
||||||
.SH EXTERNAL DEPENDENCIES
|
.SH EXTERNAL DEPENDENCIES
|
||||||
Depending on the URI protocols used, the utilities 'scp', 'rsync' and 'curl'
|
Depending on the URI protocols used, the utilities 'scp', 'rsync' and 'curl'
|
||||||
must be installed and accessible via the $PATH environment variable.
|
must be installed and accessible via the $PATH environment variable.
|
||||||
|
@ -317,7 +323,8 @@ http://www.gnu.org/licenses/gpl-2.0.txt for more information.
|
||||||
.BR taskrc(5),
|
.BR taskrc(5),
|
||||||
.BR task-faq(5),
|
.BR task-faq(5),
|
||||||
.BR task-color(5),
|
.BR task-color(5),
|
||||||
.BR task-tutorial(5)
|
.BR task-tutorial(5),
|
||||||
|
.BR ssh_config(5)
|
||||||
|
|
||||||
For more information regarding task, the following may be referenced:
|
For more information regarding task, the following may be referenced:
|
||||||
|
|
||||||
|
|
13
src/TDB.cpp
13
src/TDB.cpp
|
@ -1356,9 +1356,14 @@ void TDB::merge (const std::string& mergeFile)
|
||||||
{
|
{
|
||||||
// nothing happend on the remote branch
|
// nothing happend on the remote branch
|
||||||
// local branch is up-to-date
|
// local branch is up-to-date
|
||||||
throw std::string ("Database is up to date.");
|
|
||||||
|
// nothing happend on the local branch either
|
||||||
|
if (lit == l.end())
|
||||||
|
throw std::string ("Database is up to date.");
|
||||||
|
else
|
||||||
|
std::cout << "No changes were made on the remote database.\n";
|
||||||
}
|
}
|
||||||
else // lit == undo.end ()
|
else // lit == l.end ()
|
||||||
{
|
{
|
||||||
// nothing happend on the local branch
|
// nothing happend on the local branch
|
||||||
std::cout << "No changes were made on the local database. Adding remote changes...\n";
|
std::cout << "No changes were made on the local database. Adding remote changes...\n";
|
||||||
|
@ -1541,10 +1546,6 @@ void TDB::merge (const std::string& mergeFile)
|
||||||
if (! File::write (undoFile, undo, false))
|
if (! File::write (undoFile, undo, false))
|
||||||
throw std::string ("Could not write '") + undoFile + "'.";
|
throw std::string ("Could not write '") + undoFile + "'.";
|
||||||
}
|
}
|
||||||
else // nothing to be done
|
|
||||||
{
|
|
||||||
std::cout << "No merge required.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete objects
|
// delete objects
|
||||||
lmods.clear ();
|
lmods.clear ();
|
||||||
|
|
|
@ -38,10 +38,16 @@ TransportCurl::TransportCurl(const Uri& uri) : Transport(uri)
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void TransportCurl::send(const std::string& source)
|
void TransportCurl::send(const std::string& source)
|
||||||
{
|
{
|
||||||
if (uri.host == "")
|
if (uri.host == "")
|
||||||
throw std::string ("when using the 'curl' protocol, the uri must contain a hostname.");
|
throw std::string ("when using the 'curl' protocol, the uri must contain a hostname.");
|
||||||
|
|
||||||
if (is_filelist(source))
|
if (uri.user != "")
|
||||||
|
{
|
||||||
|
arguments.push_back("--user");
|
||||||
|
arguments.push_back(uri.user);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_filelist(source))
|
||||||
{
|
{
|
||||||
std::string::size_type pos;
|
std::string::size_type pos;
|
||||||
pos = source.find("{");
|
pos = source.find("{");
|
||||||
|
@ -76,25 +82,32 @@ void TransportCurl::send(const std::string& source)
|
||||||
arguments.push_back (source);
|
arguments.push_back (source);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cmd line is: curl -T source protocol://host:port/path
|
// cmd line is: curl -T source protocol://host:port/path
|
||||||
if (uri.port != "")
|
if (uri.port != "")
|
||||||
{
|
{
|
||||||
arguments.push_back (uri.protocol + "://" + uri.host + ":" + uri.port + "/" + uri.path);
|
arguments.push_back (uri.protocol + "://" + uri.host + ":" + uri.port + "/" + uri.path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
arguments.push_back (uri.protocol + "://" + uri.host + "/" + uri.path);
|
arguments.push_back (uri.protocol + "://" + uri.host + "/" + uri.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (execute())
|
if (execute())
|
||||||
throw std::string ("Could not run curl. Is it installed, and available in $PATH?");
|
throw std::string ("Could not run curl. Is it installed, and available in $PATH?");
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void TransportCurl::recv(std::string target)
|
void TransportCurl::recv(std::string target)
|
||||||
{
|
{
|
||||||
if (uri.host == "")
|
if (uri.host == "")
|
||||||
throw std::string ("when using the 'curl' protocol, the uri must contain a hostname.");
|
throw std::string ("when using the 'curl' protocol, the uri must contain a hostname.");
|
||||||
|
|
||||||
|
if (uri.user != "")
|
||||||
|
{
|
||||||
|
arguments.push_back("--user");
|
||||||
|
arguments.push_back(uri.user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (is_filelist(uri.path))
|
if (is_filelist(uri.path))
|
||||||
{
|
{
|
||||||
|
@ -127,20 +140,20 @@ void TransportCurl::recv(std::string target)
|
||||||
target = "-o " + target;
|
target = "-o " + target;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cmd line is: curl protocol://host:port/path/to/source/file -o path/to/target/file
|
// cmd line is: curl protocol://host:port/path/to/source/file -o path/to/target/file
|
||||||
if (uri.port != "")
|
if (uri.port != "")
|
||||||
{
|
{
|
||||||
arguments.push_back (uri.protocol + "://" + uri.host + ":" + uri.port + "/" + uri.path);
|
arguments.push_back (uri.protocol + "://" + uri.host + ":" + uri.port + "/" + uri.path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
arguments.push_back (uri.protocol + "://" + uri.host + "/" + uri.path);
|
arguments.push_back (uri.protocol + "://" + uri.host + "/" + uri.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
arguments.push_back (target);
|
arguments.push_back (target);
|
||||||
|
|
||||||
if (execute())
|
if (execute())
|
||||||
throw std::string ("Could not run curl. Is it installed, and available in $PATH?");
|
throw std::string ("Could not run curl. Is it installed, and available in $PATH?");
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue