Show More
@@ -2784,7 +2784,11 b' def pull(ui, repo, source="default", **o' | |||||
2784 | modheads = repo.pull(other, heads=revs, force=opts.get('force')) |
|
2784 | modheads = repo.pull(other, heads=revs, force=opts.get('force')) | |
2785 | if checkout: |
|
2785 | if checkout: | |
2786 | checkout = str(repo.changelog.rev(other.lookup(checkout))) |
|
2786 | checkout = str(repo.changelog.rev(other.lookup(checkout))) | |
2787 | return postincoming(ui, repo, modheads, opts.get('update'), checkout) |
|
2787 | repo._subtoppath = source | |
|
2788 | try: | |||
|
2789 | return postincoming(ui, repo, modheads, opts.get('update'), checkout) | |||
|
2790 | finally: | |||
|
2791 | del repo._subtoppath | |||
2788 |
|
2792 | |||
2789 | def push(ui, repo, dest=None, **opts): |
|
2793 | def push(ui, repo, dest=None, **opts): | |
2790 | """push changes to the specified destination |
|
2794 | """push changes to the specified destination | |
@@ -2823,13 +2827,16 b' def push(ui, repo, dest=None, **opts):' | |||||
2823 | if revs: |
|
2827 | if revs: | |
2824 | revs = [repo.lookup(rev) for rev in revs] |
|
2828 | revs = [repo.lookup(rev) for rev in revs] | |
2825 |
|
2829 | |||
2826 | # push subrepos depth-first for coherent ordering |
|
2830 | repo._subtoppath = dest | |
2827 | c = repo[''] |
|
2831 | try: | |
2828 | subs = c.substate # only repos that are committed |
|
2832 | # push subrepos depth-first for coherent ordering | |
2829 | for s in sorted(subs): |
|
2833 | c = repo[''] | |
2830 | if not c.sub(s).push(opts.get('force')): |
|
2834 | subs = c.substate # only repos that are committed | |
2831 | return False |
|
2835 | for s in sorted(subs): | |
2832 |
|
2836 | if not c.sub(s).push(opts.get('force')): | ||
|
2837 | return False | |||
|
2838 | finally: | |||
|
2839 | del repo._subtoppath | |||
2833 | r = repo.push(other, opts.get('force'), revs=revs, |
|
2840 | r = repo.push(other, opts.get('force'), revs=revs, | |
2834 | newbranch=opts.get('new_branch')) |
|
2841 | newbranch=opts.get('new_branch')) | |
2835 | return r == 0 |
|
2842 | return r == 0 |
@@ -187,6 +187,8 b' def _abssource(repo, push=False, abort=T' | |||||
187 | else: # plain file system path |
|
187 | else: # plain file system path | |
188 | return posixpath.normpath(os.path.join(parent, repo._subsource)) |
|
188 | return posixpath.normpath(os.path.join(parent, repo._subsource)) | |
189 | else: # recursion reached top repo |
|
189 | else: # recursion reached top repo | |
|
190 | if hasattr(repo, '_subtoppath'): | |||
|
191 | return repo._subtoppath | |||
190 | if push and repo.ui.config('paths', 'default-push'): |
|
192 | if push and repo.ui.config('paths', 'default-push'): | |
191 | return repo.ui.config('paths', 'default-push') |
|
193 | return repo.ui.config('paths', 'default-push') | |
192 | if repo.ui.config('paths', 'default'): |
|
194 | if repo.ui.config('paths', 'default'): |
@@ -636,12 +636,23 b' Try the same, but with pull -u' | |||||
636 | adding manifests |
|
636 | adding manifests | |
637 | adding file changes |
|
637 | adding file changes | |
638 | added 1 changesets with 2 changes to 2 files |
|
638 | added 1 changesets with 2 changes to 2 files | |
639 | abort: default path for subrepository sub/repo not found |
|
639 | pulling subrepo sub/repo from issue1852a/sub/repo | |
640 | [255] |
|
640 | requesting all changes | |
|
641 | adding changesets | |||
|
642 | adding manifests | |||
|
643 | adding file changes | |||
|
644 | added 2 changesets with 2 changes to 1 files | |||
|
645 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
641 |
|
646 | |||
642 | Try to push from the other side |
|
647 | Try to push from the other side | |
643 |
|
648 | |||
644 | $ hg -R issue1852a push issue1852c |
|
649 | $ hg -R issue1852a push `pwd`/issue1852c | |
645 | pushing to issue1852c |
|
650 | pushing to $TESTTMP/sub/issue1852c | |
646 | abort: default path for subrepository sub/repo not found |
|
651 | pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo | |
647 | [255] |
|
652 | searching for changes | |
|
653 | no changes found | |||
|
654 | searching for changes | |||
|
655 | adding changesets | |||
|
656 | adding manifests | |||
|
657 | adding file changes | |||
|
658 | added 1 changesets with 1 changes to 1 files |
General Comments 0
You need to be logged in to leave comments.
Login now