Mercurial > public > mercurial-scm > hg
comparison mercurial/filelog.py @ 1116:0cdd73b0767c
Add some rename debugging support
author | mpm@selenic.com |
---|---|
date | Sat, 27 Aug 2005 20:58:53 -0700 |
parents | 142b5d5ec9cc |
children | 30ab5b8ee8ec |
comparison
equal
deleted
inserted
replaced
1115:89f54e72581d | 1116:0cdd73b0767c |
---|---|
38 return t[s+2:] | 38 return t[s+2:] |
39 | 39 |
40 def readmeta(self, node): | 40 def readmeta(self, node): |
41 t = self.revision(node) | 41 t = self.revision(node) |
42 if not t.startswith('\1\n'): | 42 if not t.startswith('\1\n'): |
43 return t | 43 return {} |
44 s = t.find('\1\n', 2) | 44 s = t.find('\1\n', 2) |
45 mt = t[2:s] | 45 mt = t[2:s] |
46 m = {} | |
46 for l in mt.splitlines(): | 47 for l in mt.splitlines(): |
47 k, v = l.split(": ", 1) | 48 k, v = l.split(": ", 1) |
48 m[k] = v | 49 m[k] = v |
49 return m | 50 return m |
50 | 51 |
53 mt = "" | 54 mt = "" |
54 if meta: | 55 if meta: |
55 mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ] | 56 mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ] |
56 text = "\1\n" + "".join(mt) + "\1\n" + text | 57 text = "\1\n" + "".join(mt) + "\1\n" + text |
57 return self.addrevision(text, transaction, link, p1, p2) | 58 return self.addrevision(text, transaction, link, p1, p2) |
59 | |
60 def renamed(self, node): | |
61 if 0 and self.parents(node)[0] != nullid: | |
62 print "shortcut" | |
63 return False | |
64 m = self.readmeta(node) | |
65 if m and m.has_key("copy"): | |
66 return (m["copy"], bin(m["copyrev"])) | |
67 return False | |
58 | 68 |
59 def annotate(self, node): | 69 def annotate(self, node): |
60 | 70 |
61 def decorate(text, rev): | 71 def decorate(text, rev): |
62 return ([rev] * len(text.splitlines()), text) | 72 return ([rev] * len(text.splitlines()), text) |