118 s = t.index('\1\n', 2) |
119 s = t.index('\1\n', 2) |
119 return t[s + 2:] |
120 return t[s + 2:] |
120 |
121 |
121 def add(self, text, meta, transaction, link, p1=None, p2=None): |
122 def add(self, text, meta, transaction, link, p1=None, p2=None): |
122 if meta or text.startswith('\1\n'): |
123 if meta or text.startswith('\1\n'): |
123 text = revlog.packmeta(meta, text) |
124 text = storageutil.packmeta(meta, text) |
124 return self.addrevision(text, transaction, link, p1, p2) |
125 return self.addrevision(text, transaction, link, p1, p2) |
125 |
126 |
126 def renamed(self, node): |
127 def renamed(self, node): |
127 if self.parents(node)[0] != revlog.nullid: |
128 if self.parents(node)[0] != revlog.nullid: |
128 return False |
129 return False |
129 t = self.revision(node) |
130 t = self.revision(node) |
130 m = revlog.parsemeta(t)[0] |
131 m = storageutil.parsemeta(t)[0] |
131 # copy and copyrev occur in pairs. In rare cases due to bugs, |
132 # copy and copyrev occur in pairs. In rare cases due to bugs, |
132 # one can occur without the other. |
133 # one can occur without the other. |
133 if m and "copy" in m and "copyrev" in m: |
134 if m and "copy" in m and "copyrev" in m: |
134 return (m["copy"], revlog.bin(m["copyrev"])) |
135 return (m["copy"], revlog.bin(m["copyrev"])) |
135 return False |
136 return False |