equal
deleted
inserted
replaced
676 self._gitcommand(cmd) |
676 self._gitcommand(cmd) |
677 # make sure commit works otherwise HEAD might not exist under certain |
677 # make sure commit works otherwise HEAD might not exist under certain |
678 # circumstances |
678 # circumstances |
679 return self._gitstate() |
679 return self._gitstate() |
680 |
680 |
|
681 def merge(self, state): |
|
682 source, revision, kind = state |
|
683 self._fetch(source, revision) |
|
684 base = self._gitcommand(['merge-base', revision, |
|
685 self._state[1]]).strip() |
|
686 if base == revision: |
|
687 self.get(state) # fast forward merge |
|
688 elif base != self._state[1]: |
|
689 self._gitcommand(['merge', '--no-commit', revision]) |
|
690 |
|
691 def push(self, force): |
|
692 cmd = ['push'] |
|
693 if force: |
|
694 cmd.append('--force') |
|
695 # as subrepos have no notion of "where to push to" we |
|
696 # assume origin master. This is git's default |
|
697 self._gitcommand(cmd + ['origin', 'master', '-q']) |
|
698 return True |
|
699 |
681 types = { |
700 types = { |
682 'hg': hgsubrepo, |
701 'hg': hgsubrepo, |
683 'svn': svnsubrepo, |
702 'svn': svnsubrepo, |
684 'git': gitsubrepo, |
703 'git': gitsubrepo, |
685 } |
704 } |