Skip to content

Commit

Permalink
Merge pull request #1794 from Unity-Technologies/master
Browse files Browse the repository at this point in the history
Fix: Instead of pull everything should it be pull --rev (branch or rev)
  • Loading branch information
tardyp committed Aug 2, 2015
2 parents 5e5173e + d73354a commit ca00f9c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
12 changes: 10 additions & 2 deletions master/buildbot/steps/source/mercurial.py
Expand Up @@ -148,7 +148,7 @@ def mode_incremental(self, _):
@defer.inlineCallbacks
def _cmd(updatable):
if updatable:
yield self._dovccmd(['pull', self.repourl])
yield self._dovccmd(self.getHgPullCommand())
return
else:
yield self._clone()
Expand Down Expand Up @@ -221,8 +221,16 @@ def _checkBranchChange(self, _):
log.msg(msg)
yield self._removeAddedFilesAndUpdate(None)

def _pullUpdate(self, res):
def getHgPullCommand(self):
command = ['pull', self.repourl]
if self.revision:
command.extend(['--rev', self.revision])
elif self.branchType == 'inrepo':
command.extend(['--rev', self.update_branch])
return command

def _pullUpdate(self, res):
command = self.getHgPullCommand()
d = self._dovccmd(command)
d.addCallback(self._checkBranchChange)
return d
Expand Down
28 changes: 14 additions & 14 deletions master/buildbot/test/unit/test_steps_source_mercurial.py
Expand Up @@ -78,7 +78,7 @@ def test_mode_full_clean(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -124,7 +124,7 @@ def test_mode_full_clean_win32path(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -173,7 +173,7 @@ def test_mode_full_clean_timeout(self):
ExpectShell(workdir='wkdir',
timeout=1,
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
timeout=1,
Expand Down Expand Up @@ -223,7 +223,7 @@ def test_mode_full_clean_patch(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -286,7 +286,7 @@ def test_mode_full_clean_patch_fail(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -404,7 +404,7 @@ def test_mode_full_fresh(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -689,7 +689,7 @@ def test_mode_incremental_existing_repo(self):
+ 0, # directory exists
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -729,7 +729,7 @@ def test_mode_incremental_existing_repo_added_files(self):
+ 0, # directory exists
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -774,7 +774,7 @@ def test_mode_incremental_existing_repo_added_files_old_rmdir(self):
+ 0, # directory exists
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'default'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -824,7 +824,7 @@ def test_mode_incremental_given_revision(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'abcdef01'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -866,7 +866,7 @@ def test_mode_incremental_branch_change(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'stable'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -913,7 +913,7 @@ def test_mode_incremental_branch_change_no_clobberOnBranchChange(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'])
'http://hg.mozilla.org', '--rev', 'stable'])
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'])
Expand Down Expand Up @@ -958,7 +958,7 @@ def test_mode_full_clean_env(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'], env={'abc': '123'})
'http://hg.mozilla.org', '--rev', 'default'], env={'abc': '123'})
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'identify', '--branch'],
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def test_mode_full_clean_logEnviron(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['hg', '--verbose', 'pull',
'http://hg.mozilla.org'],
'http://hg.mozilla.org', '--rev', 'default'],
logEnviron=False)
+ 0,
ExpectShell(workdir='wkdir',
Expand Down

0 comments on commit ca00f9c

Please sign in to comment.