##// END OF EJS Templates
push: propagate --new-branch and --ssh options when pushing subrepos...
Angel Ezquerra -
r15708:309e4949 default
parent child Browse files
Show More
@@ -4362,7 +4362,7 b' def push(ui, repo, dest=None, **opts):'
4362 c = repo['']
4362 c = repo['']
4363 subs = c.substate # only repos that are committed
4363 subs = c.substate # only repos that are committed
4364 for s in sorted(subs):
4364 for s in sorted(subs):
4365 if not c.sub(s).push(opts.get('force')):
4365 if not c.sub(s).push(opts):
4366 return False
4366 return False
4367 finally:
4367 finally:
4368 del repo._subtoppath
4368 del repo._subtoppath
@@ -303,7 +303,7 b' class abstractsubrepo(object):'
303 """merge currently-saved state with the new state."""
303 """merge currently-saved state with the new state."""
304 raise NotImplementedError
304 raise NotImplementedError
305
305
306 def push(self, force):
306 def push(self, opts):
307 """perform whatever action is analogous to 'hg push'
307 """perform whatever action is analogous to 'hg push'
308
308
309 This may be a no-op on some systems.
309 This may be a no-op on some systems.
@@ -519,19 +519,23 b' class hgsubrepo(abstractsubrepo):'
519 else:
519 else:
520 mergefunc()
520 mergefunc()
521
521
522 def push(self, force):
522 def push(self, opts):
523 force = opts.get('force')
524 newbranch = opts.get('new_branch')
525 ssh = opts.get('ssh')
526
523 # push subrepos depth-first for coherent ordering
527 # push subrepos depth-first for coherent ordering
524 c = self._repo['']
528 c = self._repo['']
525 subs = c.substate # only repos that are committed
529 subs = c.substate # only repos that are committed
526 for s in sorted(subs):
530 for s in sorted(subs):
527 if not c.sub(s).push(force):
531 if not c.sub(s).push(opts):
528 return False
532 return False
529
533
530 dsturl = _abssource(self._repo, True)
534 dsturl = _abssource(self._repo, True)
531 self._repo.ui.status(_('pushing subrepo %s to %s\n') %
535 self._repo.ui.status(_('pushing subrepo %s to %s\n') %
532 (subrelpath(self), dsturl))
536 (subrelpath(self), dsturl))
533 other = hg.peer(self._repo.ui, {}, dsturl)
537 other = hg.peer(self._repo.ui, {'ssh': ssh}, dsturl)
534 return self._repo.push(other, force)
538 return self._repo.push(other, force, newbranch=newbranch)
535
539
536 def outgoing(self, ui, dest, opts):
540 def outgoing(self, ui, dest, opts):
537 return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts)
541 return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts)
@@ -731,7 +735,7 b' class svnsubrepo(abstractsubrepo):'
731 if _updateprompt(self._ui, self, dirty, self._wcrev(), new):
735 if _updateprompt(self._ui, self, dirty, self._wcrev(), new):
732 self.get(state, False)
736 self.get(state, False)
733
737
734 def push(self, force):
738 def push(self, opts):
735 # push is a no-op for SVN
739 # push is a no-op for SVN
736 return True
740 return True
737
741
@@ -1025,7 +1029,9 b' class gitsubrepo(abstractsubrepo):'
1025 else:
1029 else:
1026 mergefunc()
1030 mergefunc()
1027
1031
1028 def push(self, force):
1032 def push(self, opts):
1033 force = opts.get('force')
1034
1029 if not self._state[1]:
1035 if not self._state[1]:
1030 return True
1036 return True
1031 if self._gitmissing():
1037 if self._gitmissing():
General Comments 0
You need to be logged in to leave comments. Login now