Skip to content

Commit

Permalink
See buildbot#446. Mercurial should clone to specific rev when in clob…
Browse files Browse the repository at this point in the history
…ber and dirname-branch mode
  • Loading branch information
marcus-sonestedt committed May 17, 2009
1 parent f120bba commit 483a604
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions buildbot/slave/commands.py
Expand Up @@ -2469,7 +2469,7 @@ class Mercurial(SourceBase):
"""Mercurial specific VC operation. In addition to the arguments
handled by SourceBase, this command reads the following keys:
['repourl'] (required): the Cogito repository string
['repourl'] (required): the Mercurial repository string
"""

header = "mercurial operation"
Expand All @@ -2480,6 +2480,7 @@ def setup(self, args):
self.repourl = args['repourl']
self.clobberOnBranchChange = args['clobberOnBranchChange']
self.sourcedata = "%s\n" % self.repourl
self.branchType = args['branchType']
self.stdout = ""
self.stderr = ""

Expand Down Expand Up @@ -2511,7 +2512,14 @@ def _handleEmptyUpdate(self, res):

def doVCFull(self):
d = os.path.join(self.builder.basedir, self.srcdir)
command = [self.vcexe, 'clone', '--verbose', '--noupdate', self.repourl, d]
command = [self.vcexe, 'clone', '--verbose', '--noupdate']

# if got revision, clobbering and in dirname, only clone to specific revision
# (otherwise, do full clone to re-use .hg dir for subsequent byuilds)
if self.args.get('revision') and self.mode == 'clobber' and self.branchType == 'dirname':
command.extend(['--rev', self.args.get('revision')])
command.extend([self.repourl, d])

c = ShellCommand(self.builder, command, self.builder.basedir,
sendRC=False, timeout=self.timeout, usePTY=False)
self.command = c
Expand Down
1 change: 1 addition & 0 deletions buildbot/steps/source.py
Expand Up @@ -957,6 +957,7 @@ def startVC(self, branch, revision, patch):
self.args['revision'] = revision
self.args['patch'] = patch
self.args['clobberOnBranchChange'] = self.clobberOnBranchChange
self.args['branchType'] = self.branchType

revstuff = []
if branch is not None and branch != self.branch:
Expand Down

0 comments on commit 483a604

Please sign in to comment.