[Buildbot-commits] [Buildbot] #470: SVN step, sub-directory of branch and add peg revision

Buildbot nobody at buildbot.net
Sat Mar 12 15:46:25 UTC 2011


#470: SVN step, sub-directory of branch and add peg revision
------------------------+--------------------
Reporter:  ipv6guru     |       Owner:
    Type:  enhancement  |      Status:  new
Priority:  major        |   Milestone:  0.8.+
 Version:  0.7.10       |  Resolution:
Keywords:  svn          |
------------------------+--------------------
Description changed by dustin:

Old description:

> Details:
> 1) Allow the user to specify a sub-directory of a
> branch. Previously when using branches there was no
> way to checkout a sub-directory of the branch.
>
> 2) Add peg revision to svnurl. see
> http://svnbook.red-bean.com/nightly/en/svn.advanced.pegrevs.html
>
> Perhaps the peg revision should only be
> appended if the user has supplied a workdir argument?
> Otherwise the directory will have @<revision> tacked
> onto it's name when it is checked out.
>
> 3) Show the branch name instead of just "[branch]"
> in the status description of the step
>
> Comment 1:
>
> One drawback of adding the peg revision to the svnurl is that any
> checkouts
> in "update" mode will become checkouts in "clobber" mode. This happens
> because the .buildbot_sourcedata file, which is based on the svnurl, will
> have the revision number in it. Thus calls to
> SourceBase.sourcedataMatches() will always return False.
>
> The following patch will fix this
>

> Index: buildbot/slave/commands.py
> ===================================================================
> RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
> retrieving revision 1.77
> diff -u -r1.77 commands.py
> --- buildbot/slave/commands.py  23 Jan 2007 19:24:11 -0000      1.77
> +++ buildbot/slave/commands.py  24 Jan 2007 02:05:50 -0000
> @@ -1443,6 +1443,16 @@
> self.svnurl = args['svnurl']
> self.sourcedata = "%s\n" % self.svnurl
>
> + def sourcedataMatches(self):
> + try:
> + olddata = open(self.sourcedatafile, "r").read()
> + # do not considter peg revision if it exists
> + if oldata.split('@')[0] != self.sourcedata.split('@')[0]:
> + return False
> + except IOError:
> + return False
> + return True
> +
> def sourcedirIsUpdateable(self):
> if os.path.exists(os.path.join(self.builder.basedir,
> self.srcdir,
> ".buildbot-patched")):

New description:

 Details:

 1) Allow the user to specify a sub-directory of a branch. Previously when
 using branches there was no way to checkout a sub-directory of the branch.

  1. Add peg revision to svnurl. see http://svnbook.red-
 bean.com/nightly/en/svn.advanced.pegrevs.html

 Perhaps the peg revision should only be appended if the user has supplied
 a workdir argument? Otherwise the directory will have @<revision> tacked
 onto it's name when it is checked out.

 3) Show the branch name instead of just "[branch]" in the status
 description of the step

 Comment 1:

 One drawback of adding the peg revision to the svnurl is that any
 checkouts
 in "update" mode will become checkouts in "clobber" mode. This happens
 because the .buildbot_sourcedata file, which is based on the svnurl, will
 have the revision number in it. Thus calls to
 SourceBase.sourcedataMatches() will always return False.

 The following patch will fix this

 {{{
 Index: buildbot/slave/commands.py
 ===================================================================
 RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
 retrieving revision 1.77
 diff -u -r1.77 commands.py
 --- buildbot/slave/commands.py  23 Jan 2007 19:24:11 -0000      1.77
 +++ buildbot/slave/commands.py  24 Jan 2007 02:05:50 -0000
 @@ -1443,6 +1443,16 @@
 self.svnurl = args['svnurl']
 self.sourcedata = "%s\n" % self.svnurl

 + def sourcedataMatches(self):
 + try:
 + olddata = open(self.sourcedatafile, "r").read()
 + # do not considter peg revision if it exists
 + if oldata.split('@')[0] != self.sourcedata.split('@')[0]:
 + return False
 + except IOError:
 + return False
 + return True
 +
 def sourcedirIsUpdateable(self):
 if os.path.exists(os.path.join(self.builder.basedir,
 self.srcdir,
 ".buildbot-patched")):
 }}}

--

-- 
Ticket URL: <http://trac.buildbot.net/ticket/470#comment:5>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list