mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug #1104
Fixed the bug where the sort order of transactions with equal timestamps was not stable, i.e. due to the lack of a total order, different merges produced different sortings and hence messed up transactions which have already been merged.
This commit is contained in:
parent
89a7f2a459
commit
68c1ca3f69
4 changed files with 104 additions and 24 deletions
|
@ -1024,8 +1024,8 @@ void TDB2::merge (const std::string& mergeFile)
|
|||
mods.splice (mods.begin (), rmods);
|
||||
|
||||
DEBUG_STR ("sorting taskmod list");
|
||||
mods.sort ();
|
||||
mods_history.sort ();
|
||||
mods.sort (compareTaskmod);
|
||||
mods_history.sort (compareTaskmod);
|
||||
}
|
||||
else if (rit == r.end ())
|
||||
{
|
||||
|
@ -1232,7 +1232,7 @@ void TDB2::merge (const std::string& mergeFile)
|
|||
// at this point undo contains the lines up to the branch-off point
|
||||
// now we merge mods (new modifications from mergefile)
|
||||
// with lmods (part of old undo.data)
|
||||
lmods.sort();
|
||||
lmods.sort(compareTaskmod);
|
||||
mods.merge (lmods);
|
||||
mods.merge (mods_history);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue