##// END OF EJS Templates
subrepo: change default path in hgrc of subrepo after cloning...
Saint Germain -
r10378:e1401c74 default
parent child Browse files
Show More
@@ -183,7 +183,8 b' class hgsubrepo(object):'
183 183 util.makedirs(root)
184 184 self._repo = hg.repository(r.ui, root, create=True)
185 185 f = file(os.path.join(root, '.hg', 'hgrc'), 'w')
186 f.write('[paths]\ndefault = %s\n' % state[0])
186 f.write('[paths]\ndefault = %s\n' % os.path.join(
187 _abssource(ctx._repo), path))
187 188 f.close()
188 189 self._repo._subparent = r
189 190 self._repo._subsource = state[0]
@@ -160,5 +160,27 b' hg ci -Am1'
160 160
161 161 hg up 5
162 162 hg merge 4 # try to merge default into br again
163 cd ..
164
165 echo % test repository cloning
166 mkdir mercurial mercurial2
167 hg init nested_absolute
168 echo test > nested_absolute/foo
169 hg -R nested_absolute add
170 hg -R nested_absolute ci -mtest
171 cd mercurial
172 hg init nested_relative
173 echo test2 > nested_relative/foo2
174 hg -R nested_relative add
175 hg -R nested_relative ci -mtest2
176 hg init main
177 echo nested_relative = ../nested_relative > main/.hgsub
178 echo nested_absolute = $PWD/nested_absolute >> main/.hgsub
179 hg -R main add
180 hg -R main ci -m "add subrepos"
181 cd ..
182 hg clone mercurial/main mercurial2/main
183 cat mercurial2/main/nested_absolute/.hg/hgrc mercurial2/main/nested_relative/.hg/hgrc | sed "s:${PWD}:/tmp:"
184 rm -rf mercurial mercurial2
163 185
164 186 exit 0
@@ -243,3 +243,15 b' committing subrepository s'
243 243 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 245 (branch merge, don't forget to commit)
246 % test repository cloning
247 adding nested_absolute/foo
248 adding nested_relative/foo2
249 adding main/.hgsub
250 committing subrepository nested_relative
251 committing subrepository nested_absolute
252 updating to branch default
253 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 [paths]
255 default = /tmp/mercurial/main/nested_absolute
256 [paths]
257 default = /tmp/mercurial/main/nested_relative
General Comments 0
You need to be logged in to leave comments. Login now