comparison mercurial/hg.py @ 18511:798ab869b2ee stable

share: backout fd903f89e42b, except the test Locating the share source when no default path is available is now handled in subrepo._abssource(), so unconditionally setting a default path (and the associated problems) can be avoided. The test change reflects the fact that a default path is no longer set on the resulting share.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 27 Nov 2012 21:31:59 -0500
parents fe67107094fd
children b6b9475c563a
comparison
equal deleted inserted replaced
18510:f254ab6207ae 18511:798ab869b2ee
169 util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath) 169 util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath)
170 170
171 r = repository(ui, root) 171 r = repository(ui, root)
172 172
173 default = srcrepo.ui.config('paths', 'default') 173 default = srcrepo.ui.config('paths', 'default')
174 if not default: 174 if default:
175 # set default to source for being able to clone subrepos 175 fp = r.opener("hgrc", "w", text=True)
176 default = os.path.abspath(util.urllocalpath(origsource)) 176 fp.write("[paths]\n")
177 fp = r.opener("hgrc", "w", text=True) 177 fp.write("default = %s\n" % default)
178 fp.write("[paths]\n") 178 fp.close()
179 fp.write("default = %s\n" % default)
180 fp.close()
181 r.ui.setconfig('paths', 'default', default)
182 179
183 if update: 180 if update:
184 r.ui.status(_("updating working directory\n")) 181 r.ui.status(_("updating working directory\n"))
185 if update is not True: 182 if update is not True:
186 checkout = update 183 checkout = update