Mercurial > hg > RemoteEditor > REPSessionManager
changeset 435:2b034d12170e
early sent list shortning. not yet worked.
author | one |
---|---|
date | Sat, 16 Jan 2010 18:02:26 +0900 |
parents | 0e72945867bb |
children | 5e3532db2e07 |
files | rep/handler/Editor.java rep/handler/Translator.java test/mergertest/TestMerger.java |
diffstat | 3 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/handler/Editor.java Tue Jan 12 02:24:29 2010 +0900 +++ b/rep/handler/Editor.java Sat Jan 16 18:02:26 2010 +0900 @@ -202,7 +202,7 @@ boolean merge(REPCommand command) { //マージして送信 - return translator.catchOwnCommand(this, command.eid); + return translator.catchOwnCommand(this, command); } @Override
--- a/rep/handler/Translator.java Tue Jan 12 02:24:29 2010 +0900 +++ b/rep/handler/Translator.java Sat Jan 16 18:02:26 2010 +0900 @@ -54,7 +54,7 @@ * Start merge process. * @param cmd */ - public boolean catchOwnCommand(REPNode editor, int eid0){ + public boolean catchOwnCommand(REPNode editor, REPCommand prev){ logger.writeLog("beforeMerge:"+unMergedCmds); LinkedList<REPCommand> output = new LinkedList<REPCommand>(); // merge queue上にあるコマンドを全部undoコマンドするのと同時に @@ -63,12 +63,12 @@ output.add( createUndo(cmd0) ); } - TreeSet<REPCommand> cmds = new TreeSet<REPCommand>(new REPCommandComparator(eid0)); + TreeSet<REPCommand> cmds = new TreeSet<REPCommand>(new REPCommandComparator(1)); for( REPCommand cmd0 : editor.getSentList()) { if (cmd0.cmd==REP.REPCMD_INSERT || cmd0.cmd==REP.REPCMD_DELETE) cmds.add(cmd0); } - logger.writeLog("Ediotr"+eid+" Merge:: sorted sent list => Eid="+eid+cmds); + logger.writeLog("Ediotr"+eid+" Merge:: sorted sent list => Eid="+eid+cmds+" ack="+prev); output.addAll(cmds); // ACKが来たものは必ず先頭
--- a/test/mergertest/TestMerger.java Tue Jan 12 02:24:29 2010 +0900 +++ b/test/mergertest/TestMerger.java Sat Jan 16 18:02:26 2010 +0900 @@ -50,7 +50,7 @@ trans.transReceiveCmd(null, command); } for(int i = 0; i < commandList.size(); i++){ - trans.catchOwnCommand(this,eid); + trans.catchOwnCommand(this,null); System.out.println(); } }