Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 24454:59904edf0a5e
revlog: make converting from inline to non-line work after a strip
The checkinlinesize function, which converts inline revlogs to non-inline,
uses the current transaction's "data" field to determine how to update the
transaction after the conversion.
This change works around the missing data field, which is not in the
transaction after a strip.
author | Mike Edgar <adgar@google.com> |
---|---|
date | Wed, 25 Mar 2015 15:58:31 -0400 |
parents | 27e3ba73fbb1 |
children | 0ca8410ea345 |
comparison
equal
deleted
inserted
replaced
24453:65f1a29685ab | 24454:59904edf0a5e |
---|---|
1127 if trinfo is None: | 1127 if trinfo is None: |
1128 raise RevlogError(_("%s not found in the transaction") | 1128 raise RevlogError(_("%s not found in the transaction") |
1129 % self.indexfile) | 1129 % self.indexfile) |
1130 | 1130 |
1131 trindex = trinfo[2] | 1131 trindex = trinfo[2] |
1132 dataoff = self.start(trindex) | 1132 if trindex is not None: |
1133 dataoff = self.start(trindex) | |
1134 else: | |
1135 # revlog was stripped at start of transaction, use all leftover data | |
1136 trindex = len(self) - 1 | |
1137 dataoff = self.end(-2) | |
1133 | 1138 |
1134 tr.add(self.datafile, dataoff) | 1139 tr.add(self.datafile, dataoff) |
1135 | 1140 |
1136 if fp: | 1141 if fp: |
1137 fp.flush() | 1142 fp.flush() |