##// END OF EJS Templates
memctx: create a filectxfn if it is not callable...
Sean Farley -
r22072:443ef664 default
parent child Browse files
Show More
@@ -1596,6 +1596,20 b' class memctx(committablectx):'
1596 1596 self._filectxfn = filectxfn
1597 1597 self.substate = {}
1598 1598
1599 # if store is not callable, wrap it in a function
1600 if not callable(filectxfn):
1601 def getfilectx(repo, memctx, path):
1602 fctx = filectxfn[path]
1603 # this is weird but apparently we only keep track of one parent
1604 # (why not only store that instead of a tuple?)
1605 copied = fctx.renamed()
1606 if copied:
1607 copied = copied[0]
1608 return memfilectx(repo, path, fctx.data(),
1609 islink=fctx.islink(), isexec=fctx.isexec(),
1610 copied=copied, memctx=memctx)
1611 self._filectxfn = getfilectx
1612
1599 1613 self._extra = extra and extra.copy() or {}
1600 1614 if self._extra.get('branch', '') == '':
1601 1615 self._extra['branch'] = 'default'
General Comments 0
You need to be logged in to leave comments. Login now