comparison mercurial/hg.py @ 17938:fd903f89e42b

share: always set default path to work with subrepos (issue3518) set the default path in any case because creating subrepo looks this up. Subrepos are cloned, not shared.
author simon@laptop-tosh
date Sat, 27 Oct 2012 12:38:59 +0200
parents 7f5dab94e48c
children 4d1671b39168
comparison
equal deleted inserted replaced
17937:3cb032d50447 17938:fd903f89e42b
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 default: 174 if not default:
175 fp = r.opener("hgrc", "w", text=True) 175 # set default to source for being able to clone subrepos
176 fp.write("[paths]\n") 176 default = os.path.abspath(util.urllocalpath(origsource))
177 fp.write("default = %s\n" % default) 177 fp = r.opener("hgrc", "w", text=True)
178 fp.close() 178 fp.write("[paths]\n")
179 fp.write("default = %s\n" % default)
180 fp.close()
181 r.ui.setconfig('paths', 'default', default)
179 182
180 if update: 183 if update:
181 r.ui.status(_("updating working directory\n")) 184 r.ui.status(_("updating working directory\n"))
182 if update is not True: 185 if update is not True:
183 checkout = update 186 checkout = update