equal
deleted
inserted
replaced
1103 if templatepath is not None: |
1103 if templatepath is not None: |
1104 f = os.path.join(templatepath, name) |
1104 f = os.path.join(templatepath, name) |
1105 return f, open(f, mode='rb') |
1105 return f, open(f, mode='rb') |
1106 |
1106 |
1107 # Otherwise try to read it using the resources API |
1107 # Otherwise try to read it using the resources API |
1108 name_parts = pycompat.sysstr(name).split('/') |
1108 name_parts = name.split(b'/') |
1109 package_name = '.'.join(['mercurial', 'templates'] + name_parts[:-1]) |
1109 package_name = b'.'.join([b'mercurial', b'templates'] + name_parts[:-1]) |
1110 return ( |
1110 return ( |
1111 name, |
1111 name, |
1112 resourceutil.open_resource(package_name, name_parts[-1]), |
1112 resourceutil.open_resource(package_name, name_parts[-1]), |
1113 ) |
1113 ) |
1114 |
1114 |