From f6cfa1dfa5ca33680f7ff7f67d78c6eabafb718b Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Fri, 6 Aug 2010 14:58:38 +0200 Subject: [PATCH] Merge command - Added call of gc() before executing the merge algorithm - Removed workaround in unit test merge.t --- src/Context.cpp | 3 ++- src/tests/merge.t | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index f7e985803..fecf8fed7 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -241,7 +241,8 @@ int Context::dispatch (std::string &out) else if (cmd.command == "shell") { handleShell ( ); } #endif else if (cmd.command == "undo") { handleUndo ( ); } - else if (cmd.command == "_merge") { handleMerge (out); } + else if (cmd.command == "_merge") { tdb.gc (); + handleMerge (out); } else if (cmd.command == "_projects") { rc = handleCompletionProjects (out); } else if (cmd.command == "_tags") { rc = handleCompletionTags (out); } else if (cmd.command == "_commands") { rc = handleCompletionCommands (out); } diff --git a/src/tests/merge.t b/src/tests/merge.t index 42e1a3096..31b56c07e 100755 --- a/src/tests/merge.t +++ b/src/tests/merge.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 40; +use Test::More tests => 42; use File::Copy; use constant false => 0; @@ -132,22 +132,20 @@ sleep(1); # make new remote modifications qx{../task rc:remote.rc 4 +gym}; # right_newer -# invoke gc -qx{../task rc:local.rc}; -qx{../task rc:remote.rc}; - # merge remote into local my $output_l = qx{../task rc:local.rc _merge remote/undo.data}; #check output -unlike ($output_l, qr/Missing/, "local-merge: no missing entry"); +like ($output_l, qr/Running redo/, "local-merge finished"); +unlike ($output_l, qr/Missing/, "local-merge: no missing entry"); unlike ($output_l, qr/Not adding duplicate/, "local-merge: no duplicates"); # merge local into remote my $output_r = qx{../task rc:remote.rc _merge local/undo.data}; # check output -unlike ($output_r, qr/Missing/, "remote-merge: no missing entry"); +like ($output_r, qr/Running redo/, "remote-merge finished"); +unlike ($output_r, qr/Missing/, "remote-merge: no missing entry"); unlike ($output_r, qr/Not adding duplicate/, "remote-merge: no duplicates"); # check reports