Show More
@@ -94,20 +94,19 b' class changelog(revlog.revlog):' | |||
|
94 | 94 | self._divert = False |
|
95 | 95 | revlog.revlog.__init__(self, self._delayopener, "00changelog.i") |
|
96 | 96 | |
|
97 | ||
|
98 | 97 | def delayupdate(self): |
|
99 | 98 | "delay visibility of index updates to other readers" |
|
100 | 99 | self._delayed = True |
|
101 | 100 | self._divert = (len(self) == 0) |
|
102 | 101 | self._delaybuf = [] |
|
103 | self._delayname = None | |
|
104 | 102 | |
|
105 | 103 | def finalize(self, tr): |
|
106 | 104 | "finalize index updates" |
|
107 | 105 | self._delayed = False |
|
108 | 106 | # move redirected index data back into place |
|
109 |
if self._d |
|
|
110 | util.rename(self._delayname + ".a", self._delayname) | |
|
107 | if self._divert: | |
|
108 | n = self._realopener(self.indexfile).name | |
|
109 | util.rename(n + ".a", n) | |
|
111 | 110 | elif self._delaybuf: |
|
112 | 111 | fp = self.opener(self.indexfile, 'a') |
|
113 | 112 | fp.write("".join(self._delaybuf)) |
@@ -123,7 +122,6 b' class changelog(revlog.revlog):' | |||
|
123 | 122 | return fp |
|
124 | 123 | # if we're doing an initial clone, divert to another file |
|
125 | 124 | if self._divert: |
|
126 | self._delayname = fp.name | |
|
127 | 125 | if not len(self): |
|
128 | 126 | # make sure to truncate the file |
|
129 | 127 | mode = mode.replace('a', 'w') |
@@ -149,9 +147,9 b' class changelog(revlog.revlog):' | |||
|
149 | 147 | fp2.close() |
|
150 | 148 | # switch modes so finalize can simply rename |
|
151 | 149 | self._delaybuf = [] |
|
152 |
self._d |
|
|
150 | self._divert = True | |
|
153 | 151 | |
|
154 |
if self._d |
|
|
152 | if self._divert: | |
|
155 | 153 | return True |
|
156 | 154 | |
|
157 | 155 | return False |
General Comments 0
You need to be logged in to leave comments.
Login now