Sync
- added description substrings to output of merge command
This commit is contained in:
16
src/TDB.cpp
16
src/TDB.cpp
@@ -1315,6 +1315,7 @@ void TDB::merge (const std::string& mergeFile)
|
|||||||
{
|
{
|
||||||
std::cout << "Found remote change to "
|
std::cout << "Found remote change to "
|
||||||
<< (useColor ? colorChanged.colorize (uuid) : uuid)
|
<< (useColor ? colorChanged.colorize (uuid) : uuid)
|
||||||
|
<< " \"" << cutOff (tmod_r.getBefore ().get ("description"), 10) << "\""
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
|
||||||
mods.push_front(tmod_r);
|
mods.push_front(tmod_r);
|
||||||
@@ -1330,6 +1331,7 @@ void TDB::merge (const std::string& mergeFile)
|
|||||||
{
|
{
|
||||||
std::cout << "Retaining local changes to "
|
std::cout << "Retaining local changes to "
|
||||||
<< (useColor ? colorRejected.colorize (uuid) : uuid)
|
<< (useColor ? colorRejected.colorize (uuid) : uuid)
|
||||||
|
<< " \"" << cutOff (tmod_l.getBefore ().get ("description"), 10) << "\""
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
|
||||||
// inserting right mod into history of local database
|
// inserting right mod into history of local database
|
||||||
@@ -1383,10 +1385,15 @@ void TDB::merge (const std::string& mergeFile)
|
|||||||
// local branch is up-to-date
|
// local branch is up-to-date
|
||||||
|
|
||||||
// nothing happend on the local branch either
|
// nothing happend on the local branch either
|
||||||
/*
|
|
||||||
|
// break, to suppress autopush
|
||||||
if (lit != l.end ())
|
if (lit != l.end ())
|
||||||
std::cout << "No remote changes detected.\n";
|
{
|
||||||
*/
|
mods.clear ();
|
||||||
|
lmods.clear ();
|
||||||
|
throw std::string ("Database is up-to-date, no merge required.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else // lit == l.end ()
|
else // lit == l.end ()
|
||||||
{
|
{
|
||||||
@@ -1491,6 +1498,7 @@ void TDB::merge (const std::string& mergeFile)
|
|||||||
// Update the pending record.
|
// Update the pending record.
|
||||||
std::cout << "Found remote change to "
|
std::cout << "Found remote change to "
|
||||||
<< (useColor ? colorChanged.colorize (uuid) : uuid)
|
<< (useColor ? colorChanged.colorize (uuid) : uuid)
|
||||||
|
<< " \"" << cutOff (tmod.getBefore ().get ("description"), 10) << "\""
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
|
||||||
// remove the \n from composeF4() string
|
// remove the \n from composeF4() string
|
||||||
@@ -1525,6 +1533,7 @@ void TDB::merge (const std::string& mergeFile)
|
|||||||
{
|
{
|
||||||
std::cout << "Missing "
|
std::cout << "Missing "
|
||||||
<< (useColor ? colorRejected.colorize (uuid) : uuid)
|
<< (useColor ? colorRejected.colorize (uuid) : uuid)
|
||||||
|
<< " \"" << cutOff (tmod.getBefore ().get ("description"), 10) << "\""
|
||||||
<< "\n";
|
<< "\n";
|
||||||
mods.erase (current);
|
mods.erase (current);
|
||||||
}
|
}
|
||||||
@@ -1550,6 +1559,7 @@ void TDB::merge (const std::string& mergeFile)
|
|||||||
{
|
{
|
||||||
std::cout << "Merging new remote task "
|
std::cout << "Merging new remote task "
|
||||||
<< (useColor ? colorAdded.colorize (uuid) : uuid)
|
<< (useColor ? colorAdded.colorize (uuid) : uuid)
|
||||||
|
<< " \"" << cutOff (tmod.getBefore ().get ("description"), 10) << "\""
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
|
||||||
// remove the \n from composeF4() string
|
// remove the \n from composeF4() string
|
||||||
|
|||||||
15
src/text.cpp
15
src/text.cpp
@@ -654,3 +654,18 @@ int characters (const std::string& str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::string cutOff (const std::string& str, std::string::size_type len)
|
||||||
|
{
|
||||||
|
if (str.length () > len)
|
||||||
|
{
|
||||||
|
return (str.substr(0,len-2) + "..");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string res = str;
|
||||||
|
res.resize (len, ' ');
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ bool compare (const std::string&, const std::string&, bool sensitive = true);
|
|||||||
std::string::size_type find (const std::string&, const std::string&, bool sensitive = true);
|
std::string::size_type find (const std::string&, const std::string&, bool sensitive = true);
|
||||||
std::string::size_type find (const std::string&, const std::string&, std::string::size_type, bool sensitive = true);
|
std::string::size_type find (const std::string&, const std::string&, std::string::size_type, bool sensitive = true);
|
||||||
int strippedLength (const std::string&);
|
int strippedLength (const std::string&);
|
||||||
|
std::string cutOff (const std::string&, std::string::size_type);
|
||||||
|
|
||||||
// UTF-8 aware.
|
// UTF-8 aware.
|
||||||
int characters (const std::string&);
|
int characters (const std::string&);
|
||||||
|
|||||||
Reference in New Issue
Block a user