##// END OF EJS Templates
treemanifest: speed up commit using dirty flag...
Martin von Zweigbergk -
r25221:eafa06e9 default
parent child Browse files
Show More
@@ -759,6 +759,9 b' class treemanifest(object):'
759 _diff(self, m2)
759 _diff(self, m2)
760 return result
760 return result
761
761
762 def unmodifiedsince(self, m2):
763 return not self._dirty and not m2._dirty and self._node == m2._node
764
762 def parse(self, text, readsubtree):
765 def parse(self, text, readsubtree):
763 for f, n, fl in _parse(text):
766 for f, n, fl in _parse(text):
764 if fl == 'd':
767 if fl == 'd':
@@ -951,13 +954,16 b' class manifest(revlog.revlog):'
951 return n
954 return n
952
955
953 def _addtree(self, m, transaction, link, m1, m2):
956 def _addtree(self, m, transaction, link, m1, m2):
957 # If the manifest is unchanged compared to one parent,
958 # don't write a new revision
959 if m.unmodifiedsince(m1) or m.unmodifiedsince(m2):
960 return m.node()
954 def writesubtree(subm, subp1, subp2):
961 def writesubtree(subm, subp1, subp2):
955 sublog = self.dirlog(subm.dir())
962 sublog = self.dirlog(subm.dir())
956 sublog.add(subm, transaction, link, subp1, subp2, None, None)
963 sublog.add(subm, transaction, link, subp1, subp2, None, None)
957 m.writesubtrees(m1, m2, writesubtree)
964 m.writesubtrees(m1, m2, writesubtree)
958 text = m.dirtext(self._usemanifestv2)
965 text = m.dirtext(self._usemanifestv2)
959 # If the manifest is unchanged compared to one parent,
966 # Double-check whether contents are unchanged to one parent
960 # don't write a new revision
961 if text == m1.dirtext(self._usemanifestv2):
967 if text == m1.dirtext(self._usemanifestv2):
962 n = m1.node()
968 n = m1.node()
963 elif text == m2.dirtext(self._usemanifestv2):
969 elif text == m2.dirtext(self._usemanifestv2):
General Comments 0
You need to be logged in to leave comments. Login now