diff --git a/master/buildbot/steps/source/cvs.py b/master/buildbot/steps/source/cvs.py index 359a8d3783a..83530fde287 100644 --- a/master/buildbot/steps/source/cvs.py +++ b/master/buildbot/steps/source/cvs.py @@ -177,7 +177,11 @@ def doCheckout(self, dir): def doUpdate(self): command = ['-z3', 'update', '-dP'] - if self.branch: + branch = self.branch + # special case. 'cvs update -r HEAD -D today' gives no files; see #2351 + if branch == 'HEAD' and self.revision: + branch = None + if branch: command += ['-r', self.branch] if self.revision: command += ['-D', self.revision] diff --git a/master/buildbot/test/unit/test_steps_source_cvs.py b/master/buildbot/test/unit/test_steps_source_cvs.py index 9622b28f302..9ec337f4de8 100644 --- a/master/buildbot/test/unit/test_steps_source_cvs.py +++ b/master/buildbot/test/unit/test_steps_source_cvs.py @@ -362,6 +362,36 @@ def test_mode_incremental_branch(self): self.expectOutcome(result=SUCCESS, status_text=["update"]) return self.runStep() + def test_mode_incremental_special_case(self): + self.setupStep( + cvs.CVS(cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot", + cvsmodule="mozilla/browser/", mode='incremental', + branch='HEAD', login=True), + args=dict(revision='2012-08-16 16:05:16 +0000')) + self.expectCommands( + ExpectShell(workdir='wkdir', + command=['cvs', '--version']) + + 0, + Expect('uploadFile', dict(blocksize=32768, maxsize=None, + slavesrc='Root', workdir='wkdir/CVS', + writer=ExpectRemoteRef(shell.StringFileWriter))) + + Expect.behavior(uploadString(':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot')) + + 0, + Expect('uploadFile', dict(blocksize=32768, maxsize=None, + slavesrc='Repository', workdir='wkdir/CVS', + writer=ExpectRemoteRef(shell.StringFileWriter))) + + Expect.behavior(uploadString('mozilla/browser/')) + + 0, + ExpectShell(workdir='wkdir', + command=['cvs', '-z3', 'update', '-dP', + # note, no -r HEAD here - that's the special case + '-D', '2012-08-16 16:05:16 +0000']) + + 0, + ) + + self.expectOutcome(result=SUCCESS, status_text=["update"]) + return self.runStep() + def test_mode_incremental_branch_sourcestamp(self): self.setupStep( cvs.CVS(cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot",