##// END OF EJS Templates
memctx: add _manifest implementation that computes the filenode...
Sean Farley -
r21835:b342c3e2 default
parent child Browse files
Show More
@@ -13,6 +13,7 b' import os, errno, stat'
13 import obsolete as obsmod
13 import obsolete as obsmod
14 import repoview
14 import repoview
15 import fileset
15 import fileset
16 import revlog
16
17
17 propertycache = util.propertycache
18 propertycache = util.propertycache
18
19
@@ -1587,6 +1588,27 b' class memctx(committablectx):'
1587 """commit context to the repo"""
1588 """commit context to the repo"""
1588 return self._repo.commitctx(self)
1589 return self._repo.commitctx(self)
1589
1590
1591 @propertycache
1592 def _manifest(self):
1593 """generate a manifest based on the return values of filectxfn"""
1594
1595 # keep this simple for now; just worry about p1
1596 pctx = self._parents[0]
1597 man = pctx.manifest().copy()
1598
1599 for f, fnode in man.iteritems():
1600 p1node = nullid
1601 p2node = nullid
1602 p = pctx[f].parents()
1603 if len(p) > 0:
1604 p1node = p[0].node()
1605 if len(p) > 1:
1606 p2node = p[1].node()
1607 man[f] = revlog.hash(self[f].data(), p1node, p2node)
1608
1609 return man
1610
1611
1590 class memfilectx(committablefilectx):
1612 class memfilectx(committablefilectx):
1591 """memfilectx represents an in-memory file to commit.
1613 """memfilectx represents an in-memory file to commit.
1592
1614
General Comments 0
You need to be logged in to leave comments. Login now