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