Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 46559:9ee4e988e2be
revlog: change addrawrevision to return the revision
Differential Revision: https://phab.mercurial-scm.org/D9881
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Wed, 27 Jan 2021 00:55:20 +0100 |
parents | 07984507d553 |
children | f7b61ad3c64a |
comparison
equal
deleted
inserted
replaced
46558:07984507d553 | 46559:9ee4e988e2be |
---|---|
2110 return node | 2110 return node |
2111 | 2111 |
2112 if validatehash: | 2112 if validatehash: |
2113 self.checkhash(rawtext, node, p1=p1, p2=p2) | 2113 self.checkhash(rawtext, node, p1=p1, p2=p2) |
2114 | 2114 |
2115 return self.addrawrevision( | 2115 rev = self.addrawrevision( |
2116 rawtext, | 2116 rawtext, |
2117 transaction, | 2117 transaction, |
2118 link, | 2118 link, |
2119 p1, | 2119 p1, |
2120 p2, | 2120 p2, |
2121 node, | 2121 node, |
2122 flags, | 2122 flags, |
2123 cachedelta=cachedelta, | 2123 cachedelta=cachedelta, |
2124 deltacomputer=deltacomputer, | 2124 deltacomputer=deltacomputer, |
2125 ) | 2125 ) |
2126 return node | |
2126 | 2127 |
2127 def addrawrevision( | 2128 def addrawrevision( |
2128 self, | 2129 self, |
2129 rawtext, | 2130 rawtext, |
2130 transaction, | 2131 transaction, |
2143 dfh = None | 2144 dfh = None |
2144 if not self._inline: | 2145 if not self._inline: |
2145 dfh = self._datafp(b"a+") | 2146 dfh = self._datafp(b"a+") |
2146 ifh = self._indexfp(b"a+") | 2147 ifh = self._indexfp(b"a+") |
2147 try: | 2148 try: |
2148 self._addrevision( | 2149 return self._addrevision( |
2149 node, | 2150 node, |
2150 rawtext, | 2151 rawtext, |
2151 transaction, | 2152 transaction, |
2152 link, | 2153 link, |
2153 p1, | 2154 p1, |
2156 cachedelta, | 2157 cachedelta, |
2157 ifh, | 2158 ifh, |
2158 dfh, | 2159 dfh, |
2159 deltacomputer=deltacomputer, | 2160 deltacomputer=deltacomputer, |
2160 ) | 2161 ) |
2161 return node | |
2162 finally: | 2162 finally: |
2163 if dfh: | 2163 if dfh: |
2164 dfh.close() | 2164 dfh.close() |
2165 ifh.close() | 2165 ifh.close() |
2166 | 2166 |