test-context: add test for performing a diff on a memctx
authorSean Farley <sean.michael.farley@gmail.com>
Fri, 13 Jun 2014 15:59:18 -0700
changeset 21837 61b333b982ea
parent 21836 232038a05fdb
child 21838 0022ee690446
child 21840 0c88185c7d6c
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.
tests/test-context.py
tests/test-context.py.out
--- 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
+