Mercurial > hg-stable
comparison mercurial/hg.py @ 14156:839086b25c36
share: create 'hgrc' using an opener, like clone
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Sun, 01 May 2011 18:43:20 +0200 |
parents | 924c82157d46 |
children | 8a0fca925992 |
comparison
equal
deleted
inserted
replaced
14155:921683f14ad7 | 14156:839086b25c36 |
---|---|
144 | 144 |
145 requirements += 'shared\n' | 145 requirements += 'shared\n' |
146 file(os.path.join(roothg, 'requires'), 'w').write(requirements) | 146 file(os.path.join(roothg, 'requires'), 'w').write(requirements) |
147 file(os.path.join(roothg, 'sharedpath'), 'w').write(sharedpath) | 147 file(os.path.join(roothg, 'sharedpath'), 'w').write(sharedpath) |
148 | 148 |
149 r = repository(ui, root) | |
150 | |
149 default = srcrepo.ui.config('paths', 'default') | 151 default = srcrepo.ui.config('paths', 'default') |
150 if default: | 152 if default: |
151 f = file(os.path.join(roothg, 'hgrc'), 'w') | 153 fp = r.opener("hgrc", "w", text=True) |
152 f.write('[paths]\ndefault = %s\n' % default) | 154 fp.write("[paths]\n") |
153 f.close() | 155 fp.write("default = %s\n" % default) |
154 | 156 fp.close() |
155 r = repository(ui, root) | |
156 | 157 |
157 if update: | 158 if update: |
158 r.ui.status(_("updating working directory\n")) | 159 r.ui.status(_("updating working directory\n")) |
159 if update is not True: | 160 if update is not True: |
160 checkout = update | 161 checkout = update |