# HG changeset patch # User Sean Farley # Date 2014-06-13 22:59:18 # Node ID 61b333b982ea7baab198a188306fc05fb2850179 # Parent 232038a05fdb4a638a0dc57988945a91cdc4192c test-context: add test for performing a diff on a memctx We now see the first result of all that refactoring of memctx: we can now diff against a memctx. diff --git a/tests/test-context.py b/tests/test-context.py --- a/tests/test-context.py +++ b/tests/test-context.py @@ -41,8 +41,12 @@ def getfilectx(repo, memctx, f): return context.memfilectx(repo, f, data, 'l' in flags, 'x' in flags) ctxa = repo.changectx(0) -ctxb = context.memctx(repo, [ctxa.node(), None], - "test diff", - ["foo"], getfilectx) +ctxb = context.memctx(repo, [ctxa.node(), None], "test diff", ["foo"], + getfilectx, ctxa.user(), ctxa.date()) print ctxb.status(ctxa) + +# test performing a diff on a memctx + +for d in ctxb.diff(ctxa, git=True): + print d diff --git a/tests/test-context.py.out b/tests/test-context.py.out --- a/tests/test-context.py.out +++ b/tests/test-context.py.out @@ -3,3 +3,11 @@ ASCII : Gr?ezi! Latin-1 : Gr�ezi! UTF-8 : Grüezi! (['foo'], [], [], [], [], [], []) +diff --git a/foo b/foo + +--- a/foo ++++ b/foo +@@ -1,1 +1,2 @@ + foo ++bar +