Show More
@@ -1266,35 +1266,6 class committablectx(basectx): | |||||
1266 | return self._repo.dirstate.flagfunc(self._buildflagfunc) |
|
1266 | return self._repo.dirstate.flagfunc(self._buildflagfunc) | |
1267 |
|
1267 | |||
1268 | @propertycache |
|
1268 | @propertycache | |
1269 | def _manifest(self): |
|
|||
1270 | """generate a manifest corresponding to the values in self._status |
|
|||
1271 |
|
||||
1272 | This reuse the file nodeid from parent, but we append an extra letter |
|
|||
1273 | when modified. Modified files get an extra 'm' while added files get |
|
|||
1274 | an extra 'a'. This is used by manifests merge to see that files |
|
|||
1275 | are different and by update logic to avoid deleting newly added files. |
|
|||
1276 | """ |
|
|||
1277 | parents = self.parents() |
|
|||
1278 |
|
||||
1279 | man = parents[0].manifest().copy() |
|
|||
1280 |
|
||||
1281 | ff = self._flagfunc |
|
|||
1282 | for i, l in ((addednodeid, self._status.added), |
|
|||
1283 | (modifiednodeid, self._status.modified)): |
|
|||
1284 | for f in l: |
|
|||
1285 | man[f] = i |
|
|||
1286 | try: |
|
|||
1287 | man.setflag(f, ff(f)) |
|
|||
1288 | except OSError: |
|
|||
1289 | pass |
|
|||
1290 |
|
||||
1291 | for f in self._status.deleted + self._status.removed: |
|
|||
1292 | if f in man: |
|
|||
1293 | del man[f] |
|
|||
1294 |
|
||||
1295 | return man |
|
|||
1296 |
|
||||
1297 | @propertycache |
|
|||
1298 | def _status(self): |
|
1269 | def _status(self): | |
1299 | return self._repo.status() |
|
1270 | return self._repo.status() | |
1300 |
|
1271 | |||
@@ -1655,6 +1626,39 class workingctx(committablectx): | |||||
1655 |
|
1626 | |||
1656 | return s |
|
1627 | return s | |
1657 |
|
1628 | |||
|
1629 | @propertycache | |||
|
1630 | def _manifest(self): | |||
|
1631 | """generate a manifest corresponding to the values in self._status | |||
|
1632 | ||||
|
1633 | This reuse the file nodeid from parent, but we use special node | |||
|
1634 | identifiers for added and modified files. This is used by manifests | |||
|
1635 | merge to see that files are different and by update logic to avoid | |||
|
1636 | deleting newly added files. | |||
|
1637 | """ | |||
|
1638 | return self._buildstatusmanifest(self._status) | |||
|
1639 | ||||
|
1640 | def _buildstatusmanifest(self, status): | |||
|
1641 | """Builds a manifest that includes the given status results.""" | |||
|
1642 | parents = self.parents() | |||
|
1643 | ||||
|
1644 | man = parents[0].manifest().copy() | |||
|
1645 | ||||
|
1646 | ff = self._flagfunc | |||
|
1647 | for i, l in ((addednodeid, status.added), | |||
|
1648 | (modifiednodeid, status.modified)): | |||
|
1649 | for f in l: | |||
|
1650 | man[f] = i | |||
|
1651 | try: | |||
|
1652 | man.setflag(f, ff(f)) | |||
|
1653 | except OSError: | |||
|
1654 | pass | |||
|
1655 | ||||
|
1656 | for f in status.deleted + status.removed: | |||
|
1657 | if f in man: | |||
|
1658 | del man[f] | |||
|
1659 | ||||
|
1660 | return man | |||
|
1661 | ||||
1658 | def _buildstatus(self, other, s, match, listignored, listclean, |
|
1662 | def _buildstatus(self, other, s, match, listignored, listclean, | |
1659 | listunknown): |
|
1663 | listunknown): | |
1660 | """build a status with respect to another context |
|
1664 | """build a status with respect to another context |
General Comments 0
You need to be logged in to leave comments.
Login now