Skip to content

Commit

Permalink
Merge branch 'source-method-copy-srcdir' of git://github.com/jpommere…
Browse files Browse the repository at this point in the history
…ning/buildbot
  • Loading branch information
djmitche committed Oct 20, 2013
2 parents 9dbcb9f + 209e30b commit ecb830b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
9 changes: 5 additions & 4 deletions master/buildbot/steps/source/cvs.py
Expand Up @@ -143,19 +143,20 @@ def copy(self):
'logEnviron': self.logEnviron})
cmd.useLog(self.stdio_log, False)
d = self.runCommand(cmd)
self.workdir = 'source'
old_workdir = self.workdir
self.workdir = self.srcdir
d.addCallback(lambda _: self.incremental())
def copy(_):
cmd = buildstep.RemoteCommand('cpdir',
{'fromdir': 'source',
'todir':'build',
{'fromdir': self.srcdir,
'todir': old_workdir,
'logEnviron': self.logEnviron,})
cmd.useLog(self.stdio_log, False)
d = self.runCommand(cmd)
return d
d.addCallback(copy)
def resetWorkdir(_):
self.workdir = 'build'
self.workdir = old_workdir
return 0
d.addCallback(resetWorkdir)
return d
Expand Down
10 changes: 6 additions & 4 deletions master/buildbot/steps/source/git.py
Expand Up @@ -120,6 +120,7 @@ def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None,
self.getDescription = getDescription
self.config = config
self.supportsBranch = True
self.srcdir = 'source'
Source.__init__(self, **kwargs)

if self.mode not in ['incremental', 'full']:
Expand Down Expand Up @@ -244,20 +245,21 @@ def copy(self):
cmd.useLog(self.stdio_log, False)
d = self.runCommand(cmd)

self.workdir = 'source'
old_workdir = self.workdir
self.workdir = self.srcdir
d.addCallback(lambda _: self.incremental())
def copy(_):
cmd = buildstep.RemoteCommand('cpdir',
{'fromdir': 'source',
'todir':'build',
{'fromdir': self.srcdir,
'todir': old_workdir,
'logEnviron': self.logEnviron,
'timeout': self.timeout,})
cmd.useLog(self.stdio_log, False)
d = self.runCommand(cmd)
return d
d.addCallback(copy)
def resetWorkdir(_):
self.workdir = 'build'
self.workdir = old_workdir
return 0

d.addCallback(resetWorkdir)
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/test/unit/test_steps_source_cvs.py
Expand Up @@ -431,7 +431,7 @@ def test_mode_full_copy(self):
ExpectShell(workdir='source',
command=['cvs', '-z3', 'update', '-dP'])
+ 0,
Expect('cpdir', {'fromdir': 'source', 'todir': 'build',
Expect('cpdir', {'fromdir': 'source', 'todir': 'wkdir',
'logEnviron': True})
+ 0,
)
Expand Down Expand Up @@ -470,7 +470,7 @@ def test_mode_full_copy_wrong_repo(self):
':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot',
'-z3', 'checkout', '-d', 'source', 'mozilla/browser/'])
+ 0,
Expect('cpdir', {'fromdir': 'source', 'todir': 'build',
Expect('cpdir', {'fromdir': 'source', 'todir': 'wkdir',
'logEnviron': True})
+ 0,
)
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/test/unit/test_steps_source_git.py
Expand Up @@ -1052,10 +1052,10 @@ def test_mode_full_copy(self):
ExpectShell(workdir='source',
command=['git', 'reset', '--hard', 'FETCH_HEAD', '--'])
+ 0,
Expect('cpdir', {'fromdir': 'source', 'todir': 'build',
Expect('cpdir', {'fromdir': 'source', 'todir': 'wkdir',
'logEnviron': True, 'timeout': 1200})
+ 0,
ExpectShell(workdir='build',
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
+ ExpectShell.log('stdio',
stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
Expand Down
5 changes: 5 additions & 0 deletions master/docs/relnotes/index.rst
Expand Up @@ -117,6 +117,11 @@ Features

* :bb:step:`CVS` source step now checks for "sticky dates" from a previous checkout before updating an existing source directory.

Fixes
~~~~~

* Fixed and Issue where the Git and CVS source steps silently changed the ``workdir`` to ``'build'`` when the 'copy' method is used.

Deprecations, Removals, and Non-Compatible Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit ecb830b

Please sign in to comment.