changeset 21837:61b333b982ea

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 13 Jun 2014 15:59:18 -0700
parents 232038a05fdb
children 0022ee690446 0c88185c7d6c
files tests/test-context.py tests/test-context.py.out
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-context.py	Fri Jun 13 15:56:11 2014 -0700
+++ b/tests/test-context.py	Fri Jun 13 15:59:18 2014 -0700
@@ -41,8 +41,12 @@
     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
--- a/tests/test-context.py.out	Fri Jun 13 15:56:11 2014 -0700
+++ b/tests/test-context.py.out	Fri Jun 13 15:59:18 2014 -0700
@@ -3,3 +3,11 @@
 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
+