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