comparison mercurial/filelog.py @ 35567:07769a04bc66

filelog: add the ability to report the user facing name This will be used by lfs, but is probably generally useful. There are various bits of code that reverse engineer this from the index or data file names, but it seems better to just store it. Especially if there's experimenting with backing storage other than revlog.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 07 Jan 2018 15:01:59 -0500
parents ba479850c9c7
children a3202fa83aff
comparison
equal deleted inserted replaced
35566:baca93a47992 35567:07769a04bc66
41 41
42 class filelog(revlog.revlog): 42 class filelog(revlog.revlog):
43 def __init__(self, opener, path): 43 def __init__(self, opener, path):
44 super(filelog, self).__init__(opener, 44 super(filelog, self).__init__(opener,
45 "/".join(("data", path + ".i"))) 45 "/".join(("data", path + ".i")))
46 # full name of the user visible file, relative to the repository root
47 self.filename = path
46 48
47 def read(self, node): 49 def read(self, node):
48 t = self.revision(node) 50 t = self.revision(node)
49 if not t.startswith('\1\n'): 51 if not t.startswith('\1\n'):
50 return t 52 return t