##// END OF EJS Templates
context: move contents of committablectx.markcommitted() to workingctx...
Martin von Zweigbergk -
r42481:fdd4d668 default
parent child Browse files
Show More
@@ -1226,18 +1226,6 b' class committablectx(basectx):'
1226 1226
1227 1227 """
1228 1228
1229 with self._repo.dirstate.parentchange():
1230 for f in self.modified() + self.added():
1231 self._repo.dirstate.normal(f)
1232 for f in self.removed():
1233 self._repo.dirstate.drop(f)
1234 self._repo.dirstate.setparents(node)
1235
1236 # write changes out explicitly, because nesting wlock at
1237 # runtime may prevent 'wlock.release()' in 'repo.commit()'
1238 # from immediately doing so for subsequent changing files
1239 self._repo.dirstate.write(self._repo.currenttransaction())
1240
1241 1229 def dirty(self, missing=False, merge=True, branch=True):
1242 1230 return False
1243 1231
@@ -1657,7 +1645,17 b' class workingctx(committablectx):'
1657 1645 return sorted(f for f in ds.matches(match) if ds[f] != 'r')
1658 1646
1659 1647 def markcommitted(self, node):
1660 super(workingctx, self).markcommitted(node)
1648 with self._repo.dirstate.parentchange():
1649 for f in self.modified() + self.added():
1650 self._repo.dirstate.normal(f)
1651 for f in self.removed():
1652 self._repo.dirstate.drop(f)
1653 self._repo.dirstate.setparents(node)
1654
1655 # write changes out explicitly, because nesting wlock at
1656 # runtime may prevent 'wlock.release()' in 'repo.commit()'
1657 # from immediately doing so for subsequent changing files
1658 self._repo.dirstate.write(self._repo.currenttransaction())
1661 1659
1662 1660 sparse.aftercommit(self._repo, node)
1663 1661
@@ -74,5 +74,5 b' def markcommitted(orig, committablectx, '
74 74 def extsetup(ui):
75 75 extensions.wrapfunction(context.workingctx, '_poststatusfixup',
76 76 _poststatusfixup)
77 extensions.wrapfunction(context.committablectx, 'markcommitted',
77 extensions.wrapfunction(context.workingctx, 'markcommitted',
78 78 markcommitted)
@@ -37,7 +37,7 b''
37 37 000000000000
38 38 $ hg --config extensions.closehead= close-head -m 'Close old heads' -r 1 2
39 39 $ hg id
40 340d36cac2f4 tip
40 000000000000
41 41 $ hg bookmark
42 42 @ 1:66f7d451a68b
43 43 $ hg heads
General Comments 0
You need to be logged in to leave comments. Login now