Show More
@@ -171,11 +171,14 b' def share(ui, source, dest=None, update=' | |||||
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")) |
@@ -718,6 +718,14 b' subrepository:' | |||||
718 | committing subrepository subrepo-2 |
|
718 | committing subrepository subrepo-2 | |
719 | $ hg st subrepo-2/file |
|
719 | $ hg st subrepo-2/file | |
720 |
|
720 | |||
|
721 | Check that share works with subrepo | |||
|
722 | $ hg --config extensions.share= share . ../shared | |||
|
723 | updating working directory | |||
|
724 | cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2 | |||
|
725 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
726 | $ test -f ../shared/subrepo-1/.hg/sharedpath | |||
|
727 | [1] | |||
|
728 | ||||
721 | Check hg update --clean |
|
729 | Check hg update --clean | |
722 | $ cd $TESTTMP/t |
|
730 | $ cd $TESTTMP/t | |
723 | $ rm -r t/t.orig |
|
731 | $ rm -r t/t.orig |
General Comments 0
You need to be logged in to leave comments.
Login now