From 7029773512eee5a0bb765b82cfdd90fd5ab34e15 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 23 Nov 2010 23:20:11 +0100 Subject: Implemented revlog.append_entry as classmethod, to assure we will always actually write_append the new entry, instead of rewriting the whole file. Added file-locking and directory handling, so the implementation should be similar (enough) to the git reference implementation. Next up is to implement a way to update the reflog when changing references, which is going to be a little more complicated --- test/test_reflog.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'test/test_reflog.py') diff --git a/test/test_reflog.py b/test/test_reflog.py index 67b1a9da..e99e5ba5 100644 --- a/test/test_reflog.py +++ b/test/test_reflog.py @@ -72,17 +72,12 @@ class TestRefLog(TestBase): # ... as well as each bytes of the written stream assert open(tfile).read() == open(rlp).read() - # append an entry - it gets written automatically - entry = treflog.append_entry(IndexObject.NULL_BIN_SHA, binsha, msg) + # append an entry + entry = RefLog.append_entry(tfile, IndexObject.NULL_BIN_SHA, binsha, msg) assert entry.oldhexsha == IndexObject.NULL_HEX_SHA assert entry.newhexsha == 'f'*40 assert entry.message == msg - assert treflog == RefLog.from_file(tfile) - - # but not this time - treflog.append_entry(binsha, binsha, msg, write=False) - assert treflog != RefLog.from_file(tfile) - + assert RefLog.from_file(tfile)[-1] == entry # END for each reflog -- cgit v1.2.3