comparison 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
comparison
equal deleted inserted replaced
23587:8063901e56cd 23588:87a76cff7147
1644 # removed file 1644 # removed file
1645 del man[f] 1645 del man[f]
1646 else: 1646 else:
1647 man[f] = revlog.hash(fctx.data(), p1node, p2node) 1647 man[f] = revlog.hash(fctx.data(), p1node, p2node)
1648 1648
1649 for f in self._status.added:
1650 man[f] = revlog.hash(self[f].data(), nullid, nullid)
1651
1649 return man 1652 return man
1650 1653
1651 @propertycache 1654 @propertycache
1652 def _status(self): 1655 def _status(self):
1653 """Calculate exact status from ``files`` specified at construction 1656 """Calculate exact status from ``files`` specified at construction