diff mercurial/context.py @ 23588:87a76cff7147

memctx: calculate manifest including newly added files correctly Before this patch, "memctx._manifest" calculates the manifest according to the 1st parent. This causes the disappearance of newly added files from the manifest. For example, if newly added files aren't listed up in manifest of memctx, they aren't listed up in "added" field of "status" returned by "ctx.status()", and "{diff()}" (= "patch.diff") in "committemplate" shows nothing for them. To calculate manifest including newly added files correctly, this patch puts newly added files (= ones in "self._status.added") into the manifest. Some details of changes for "test-commit-amend.t" in this patch: - "touch foo" is replaced by "echo foo > foo", because newly added empty file can't be shown in "diff()" output without "diff.git" configuration - amending is confirmed twice to examine both (1) newly added files and (2) ones already added in amended revision
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 17 Dec 2014 15:09:43 +0900
parents 8063901e56cd
children 200215cdf7aa
line wrap: on
line diff
--- a/mercurial/context.py	Wed Dec 17 15:09:38 2014 +0900
+++ b/mercurial/context.py	Wed Dec 17 15:09:43 2014 +0900
@@ -1646,6 +1646,9 @@
             else:
                 man[f] = revlog.hash(fctx.data(), p1node, p2node)
 
+        for f in self._status.added:
+            man[f] = revlog.hash(self[f].data(), nullid, nullid)
+
         return man
 
     @propertycache