Show More
@@ -609,12 +609,11 b' class hgsubrepo(abstractsubrepo):' | |||
|
609 | 609 | self._repo._subsource = source |
|
610 | 610 | |
|
611 | 611 | if create: |
|
612 | fp = self._repo.opener("hgrc", "w", text=True) | |
|
613 | fp.write('[paths]\n') | |
|
612 | lines = ['[paths]\n'] | |
|
614 | 613 | |
|
615 | 614 | def addpathconfig(key, value): |
|
616 | 615 | if value: |
|
617 |
|
|
|
616 | lines.append('%s = %s\n' % (key, value)) | |
|
618 | 617 | self._repo.ui.setconfig('paths', key, value, 'subrepo') |
|
619 | 618 | |
|
620 | 619 | defpath = _abssource(self._repo, abort=False) |
@@ -622,7 +621,12 b' class hgsubrepo(abstractsubrepo):' | |||
|
622 | 621 | addpathconfig('default', defpath) |
|
623 | 622 | if defpath != defpushpath: |
|
624 | 623 | addpathconfig('default-push', defpushpath) |
|
625 | fp.close() | |
|
624 | ||
|
625 | fp = self._repo.opener("hgrc", "w", text=True) | |
|
626 | try: | |
|
627 | fp.write(''.join(lines)) | |
|
628 | finally: | |
|
629 | fp.close() | |
|
626 | 630 | |
|
627 | 631 | @annotatesubrepoerror |
|
628 | 632 | def add(self, ui, match, dryrun, listsubrepos, prefix, explicitonly): |
General Comments 0
You need to be logged in to leave comments.
Login now