This instance will be upgraded to Heptapod 0.26.0rc1 on 2021-10-25 at 14:00 UTC+2 (a few minutes of down time)

Commit 2a1f6e09 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Project.put_hgrc: allow to write on secondary files

parent e86d56bf10d1
......@@ -755,15 +755,20 @@ class Project(object):
'hgrc.managed' if managed else 'hgrc'))
return self.heptapod.get_file_lines(hgrc_path)
def put_hgrc(self, lines):
def put_hgrc(self, lines, file_path='hgrc'):
"""Replace repo's server-side HGRC with given lines.
The lines have to include LF, same as with `writelines()`.
:param str file_path: relative path from the `.hg` directory of the
repo for the file to rewrite. Allows to work on a different file
than the main HGRC. Useful to manage secondary files (inclusions,
clonebundles, configexpress…)
repo_inner_path = '/'.join((self.fs_path, '.hg'))
return self.heptapod.put_file_lines(
os.path.join(repo_inner_path, 'hgrc'), lines)
os.path.join(repo_inner_path, file_path), lines)
def extend_hgrc(self, *lines):
"""Append given lines to repo's server-side HGRC
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment