Skip to content

Commit

Permalink
Implement a CVS special-case workaround
Browse files Browse the repository at this point in the history
Fixes #2351.
  • Loading branch information
djmitche committed Sep 9, 2012
1 parent f781f45 commit 7bfbf53
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
6 changes: 5 additions & 1 deletion master/buildbot/steps/source/cvs.py
Expand Up @@ -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]
Expand Down
30 changes: 30 additions & 0 deletions master/buildbot/test/unit/test_steps_source_cvs.py
Expand Up @@ -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",
Expand Down

0 comments on commit 7bfbf53

Please sign in to comment.