Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating steps.Git to allow incremental fetch. #6483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion master/buildbot/steps/source/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ def _fetch(self, _):
rev = self.revision
else:
rev = 'FETCH_HEAD'
command = ['checkout', '-f', rev]

if self.mode == 'incremental':
command = ['checkout', rev]
else:
command = ['checkout', '-f', rev]

abandonOnFailure = not self.retryFetch and not self.clobberOnFailure
res = yield self._dovccmd(command, abandonOnFailure)

Expand Down
30 changes: 15 additions & 15 deletions master/buildbot/test/unit/steps/test_source_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ def test_mode_incremental_oldworker(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir', interrupt_signal='TERM',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir', interrupt_signal='TERM',
command=['git', 'rev-parse', 'HEAD'])
Expand Down Expand Up @@ -1546,7 +1546,7 @@ def test_mode_incremental(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
Expand Down Expand Up @@ -1578,7 +1578,7 @@ def test_version_format(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
Expand Down Expand Up @@ -1646,7 +1646,7 @@ def test_mode_incremental_branch(self):
'test-branch', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-B', 'test-branch'])
Expand Down Expand Up @@ -1695,7 +1695,7 @@ def test_mode_incremental_branch_ssh_key_2_10(self):
'test-branch', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-B', 'test-branch'])
Expand Down Expand Up @@ -1801,7 +1801,7 @@ def test_mode_incremental_given_revision(self):
command=['git', 'cat-file', '-e', 'abcdef01'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'abcdef01'])
command=['git', 'checkout', 'abcdef01'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
Expand Down Expand Up @@ -1838,7 +1838,7 @@ def test_mode_incremental_given_revision_not_exists(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'abcdef01'])
command=['git', 'checkout', 'abcdef01'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
Expand Down Expand Up @@ -2105,15 +2105,15 @@ def test_mode_incremental_retryFetch(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(1),
ExpectShell(workdir='wkdir',
command=['git', 'fetch', '-f', '-t',
'http://github.com/buildbot/buildbot.git',
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
Expand Down Expand Up @@ -2146,15 +2146,15 @@ def test_mode_incremental_retryFetch_branch(self):
'test-branch', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(1),
ExpectShell(workdir='wkdir',
command=['git', 'fetch', '-f', '-t',
'http://github.com/buildbot/buildbot.git',
'test-branch', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-B', 'test-branch'])
Expand Down Expand Up @@ -2190,7 +2190,7 @@ def test_mode_incremental_clobberOnFailure(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(1),
ExpectRmdir(dir='wkdir', log_environ=True, timeout=1200)
.exit(0),
Expand Down Expand Up @@ -2230,7 +2230,7 @@ def test_mode_incremental_clobberOnFailure_branch(self):
'test-branch', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(1),
ExpectRmdir(dir='wkdir', log_environ=True, timeout=1200)
.exit(0),
Expand Down Expand Up @@ -2783,7 +2783,7 @@ def test_getDescription(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
Expand Down Expand Up @@ -2830,7 +2830,7 @@ def test_getDescription_failed(self):
'HEAD', '--progress'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'checkout', '-f', 'FETCH_HEAD'])
command=['git', 'checkout', 'FETCH_HEAD'])
.exit(0),
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
Expand Down