##// END OF EJS Templates
subrepo: propagate non-default pull/push path to relative subrepos (issue1852)
Mads Kiilerich -
r12852:5dbff89c stable
parent child Browse files
Show More
@@ -2784,7 +2784,11 b' def pull(ui, repo, source="default", **o'
2784 2784 modheads = repo.pull(other, heads=revs, force=opts.get('force'))
2785 2785 if checkout:
2786 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 2793 def push(ui, repo, dest=None, **opts):
2790 2794 """push changes to the specified destination
@@ -2823,13 +2827,16 b' def push(ui, repo, dest=None, **opts):'
2823 2827 if revs:
2824 2828 revs = [repo.lookup(rev) for rev in revs]
2825 2829
2826 # push subrepos depth-first for coherent ordering
2827 c = repo['']
2828 subs = c.substate # only repos that are committed
2829 for s in sorted(subs):
2830 if not c.sub(s).push(opts.get('force')):
2831 return False
2832
2830 repo._subtoppath = dest
2831 try:
2832 # push subrepos depth-first for coherent ordering
2833 c = repo['']
2834 subs = c.substate # only repos that are committed
2835 for s in sorted(subs):
2836 if not c.sub(s).push(opts.get('force')):
2837 return False
2838 finally:
2839 del repo._subtoppath
2833 2840 r = repo.push(other, opts.get('force'), revs=revs,
2834 2841 newbranch=opts.get('new_branch'))
2835 2842 return r == 0
@@ -187,6 +187,8 b' def _abssource(repo, push=False, abort=T'
187 187 else: # plain file system path
188 188 return posixpath.normpath(os.path.join(parent, repo._subsource))
189 189 else: # recursion reached top repo
190 if hasattr(repo, '_subtoppath'):
191 return repo._subtoppath
190 192 if push and repo.ui.config('paths', 'default-push'):
191 193 return repo.ui.config('paths', 'default-push')
192 194 if repo.ui.config('paths', 'default'):
@@ -636,12 +636,23 b' Try the same, but with pull -u'
636 636 adding manifests
637 637 adding file changes
638 638 added 1 changesets with 2 changes to 2 files
639 abort: default path for subrepository sub/repo not found
640 [255]
639 pulling subrepo sub/repo from issue1852a/sub/repo
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 647 Try to push from the other side
643 648
644 $ hg -R issue1852a push issue1852c
645 pushing to issue1852c
646 abort: default path for subrepository sub/repo not found
647 [255]
649 $ hg -R issue1852a push `pwd`/issue1852c
650 pushing to $TESTTMP/sub/issue1852c
651 pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo
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