tests/test-context.py
changeset 21836 232038a05fdb
parent 21689 503bb3af70fe
child 21837 61b333b982ea
--- a/tests/test-context.py	Thu May 29 16:12:59 2014 -0500
+++ b/tests/test-context.py	Fri Jun 13 15:56:11 2014 -0700
@@ -30,3 +30,19 @@
 for enc in "ASCII", "Latin-1", "UTF-8":
     encoding.encoding = enc
     print "%-8s: %s" % (enc, repo["tip"].description())
+
+# test performing a status
+
+def getfilectx(repo, memctx, f):
+    fctx = memctx.parents()[0][f]
+    data, flags = fctx.data(), fctx.flags()
+    if f == 'foo':
+        data += 'bar\n'
+    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)
+
+print ctxb.status(ctxa)