Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 10 commits
  • 8 files changed
  • 0 comments
  • 3 contributors
Apr 08, 2012
Tom Prince Use t.w.p.irc.IRCClient.describe instead of .me.
me was deprecated in twisted 9.0 and removed in 11.1.
bcf76be
Tom Prince Merge branch 'fix-irc-destroy' dfba038
Apr 12, 2012
Saurabh Kumar Move FakeRenderable to buildbot.test.util.properties 06865f4
Tom Prince Merge commit 'refs/pull/371/head' of github.com:buildbot/buildbot int…
…o remove-svn-baseURL
1aa1269
Tom Prince Add examples of how to replace baseURL in release notes. 2471ccb
Tom Prince Remove reference to cvs argumes in svn documentation.
These days, people aren't likely to be more familiar with cvs than svn,
and in particular configuring buildbot for cvs.
bd07db1
Apr 13, 2012
Dustin J. Mitchell fix bad deferred handling causing race-condition failures in postgres…
… tests
a4b300f
Saurabh Kumar Merge branch 'master' of https://github.com/buildbot/buildbot 1e8ccd9
Saurabh Kumar Remove baseURL in master-side SVN source step.
repourl takes over the functions of baseURL so that everything can
be done with one url for the master-side SVN source step.

Branch considerations are removed from SVN master-side step.
Branch info should be provided with Interpolate.

(refs #2066)
732c442
Saurabh Kumar Merge branch 'master' of https://github.com/buildbot/buildbot 93dcee6
2  master/buildbot/status/words.py
@@ -703,7 +703,7 @@ def send(self, message):
703 703
 
704 704
     def act(self, action):
705 705
         if not self.muted:
706  
-            self.bot.me(self.dest, action.encode("ascii", "replace"))
  706
+            self.bot.describe(self.dest, action.encode("ascii", "replace"))
707 707
 
708 708
     # main dispatchers for incoming messages
709 709
 
37  master/buildbot/steps/source/svn.py
@@ -29,20 +29,17 @@ class SVN(Source):
29 29
     """I perform Subversion checkout/update operations."""
30 30
 
31 31
     name = 'svn'
32  
-    branch_placeholder = '%%BRANCH%%'
33 32
 
34  
-    renderables = [ 'repourl', 'baseURL' ]
  33
+    renderables = [ 'repourl' ]
35 34
     possible_modes = ('incremental', 'full')
36 35
     possible_methods = ('clean', 'fresh', 'clobber', 'copy', 'export', None)
37 36
 
38  
-    def __init__(self, repourl=None, baseURL=None, mode='incremental',
39  
-                 method=None, defaultBranch=None, username=None,
  37
+    def __init__(self, repourl=None, mode='incremental',
  38
+                 method=None, username=None,
40 39
                  password=None, extra_args=None, keep_on_purge=None,
41 40
                  depth=None, **kwargs):
42 41
 
43 42
         self.repourl = repourl
44  
-        self.baseURL = baseURL
45  
-        self.branch = defaultBranch
46 43
         self.username = username
47 44
         self.password = password
48 45
         self.extra_args = extra_args
@@ -52,10 +49,8 @@ def __init__(self, repourl=None, baseURL=None, mode='incremental',
52 49
         self.mode = mode
53 50
         Source.__init__(self, **kwargs)
54 51
         self.addFactoryArguments(repourl=repourl,
55  
-                                 baseURL=baseURL,
56 52
                                  mode=mode,
57 53
                                  method=method,
58  
-                                 defaultBranch=defaultBranch,
59 54
                                  password=password,
60 55
                                  username=username,
61 56
                                  extra_args=extra_args,
@@ -68,18 +63,15 @@ def __init__(self, repourl=None, baseURL=None, mode='incremental',
68 63
         if self.method not in self.possible_methods:
69 64
             errors.append("method %s is not one of %s" % (self.method, self.possible_methods))
70 65
 
71  
-        if repourl and baseURL:
72  
-            errors.append("you must provide exactly one of repourl and baseURL")
  66
+        if repourl is None:
  67
+            errors.append("you must provide repourl")
73 68
 
74  
-        if repourl is None and baseURL is None:
75  
-            errors.append("you must privide at least one of repourl and baseURL")
76 69
         if errors:
77 70
             raise ConfigErrors(errors)
78 71
 
79 72
     def startVC(self, branch, revision, patch):
80 73
         self.revision = revision
81 74
         self.method = self._getMethod()
82  
-        self.repourl = self.getRepoUrl(branch)
83 75
         self.stdio_log = self.addLog("stdio")
84 76
 
85 77
         d = self.checkSvn()
@@ -259,25 +251,6 @@ def evaluateCommand(cmd):
259 251
         d.addCallback(lambda _: evaluateCommand(cmd))
260 252
         return d
261 253
 
262  
-    def getRepoUrl(self, branch):
263  
-        ''' Compute the svn url that will be passed to the svn remote command '''
264  
-        if self.repourl:
265  
-            return self.repourl
266  
-        else:
267  
-            if branch is None:
268  
-                m = ("The SVN source step belonging to builder '%s' does not know "
269  
-                     "which branch to work with. This means that the change source "
270  
-                     "did not specify a branch and that defaultBranch is None." \
271  
-                     % self.build.builder.name)
272  
-                raise RuntimeError(m)
273  
-
274  
-            computed = self.baseURL
275  
-
276  
-            if self.branch_placeholder in self.baseURL:
277  
-                return computed.replace(self.branch_placeholder, branch)
278  
-            else:
279  
-                return computed + branch
280  
-
281 254
     def _getMethod(self):
282 255
         if self.method is not None and self.mode != 'incremental':
283 256
             return self.method
8  master/buildbot/test/unit/test_process_properties.py
@@ -23,6 +23,7 @@
23 23
 from buildbot.process.properties import Property, PropertiesMixin
24 24
 from buildbot.interfaces import IRenderable, IProperties
25 25
 from buildbot.test.util.config import ConfigErrorsMixin
  26
+from buildbot.test.util.properties import FakeRenderable
26 27
 
27 28
 class FakeSource:
28 29
     def __init__(self):
@@ -52,13 +53,6 @@ def getSourceStamp(self, codebase):
52 53
             return self.sources[codebase]
53 54
         return None
54 55
 
55  
-class FakeRenderable(object):
56  
-    implements(IRenderable)
57  
-    def __init__(self, value):
58  
-        self.value = value
59  
-    def getRenderingFor(self, props):
60  
-        return self.value
61  
-
62 56
 class DeferredRenderable:
63 57
     implements (IRenderable)
64 58
     def __init__(self):
4  master/buildbot/test/unit/test_status_words.py
@@ -155,9 +155,9 @@ def msgOrNotice(dest, msg):
155 155
 
156 156
     def test_act(self):
157 157
         events = []
158  
-        def me(dest, msg):
  158
+        def describe(dest, msg):
159 159
             events.append((dest, msg))
160  
-        self.contact.bot.me = me
  160
+        self.contact.bot.describe = describe
161 161
 
162 162
         self.contact.act("unmuted")
163 163
         self.contact.act(u"unmuted, unicode \N{SNOWMAN}")
26  master/buildbot/test/unit/test_steps_source_svn.py
@@ -20,6 +20,7 @@
20 20
 from buildbot.test.util import sourcesteps
21 21
 from buildbot.process import buildstep
22 22
 from buildbot.test.fake.remotecommand import ExpectShell, Expect
  23
+from buildbot.test.util.properties import FakeRenderable
23 24
 from buildbot import config
24 25
 
25 26
 class TestSVN(sourcesteps.SourceStepMixin, unittest.TestCase):
@@ -56,12 +57,7 @@ def tearDown(self):
56 57
     def patch_slaveVersionIsOlderThan(self, result):
57 58
         self.patch(svn.SVN, 'slaveVersionIsOlderThan', lambda x, y, z: result)
58 59
 
59  
-    def test_repourl_and_baseURL(self):
60  
-        self.assertRaises(config.ConfigErrors, lambda :
61  
-                svn.SVN(repourl='http://svn.local/app/trunk',
62  
-                        baseURL='http://svn.local/app/trunk'))
63  
-
64  
-    def test_no_repourl_and_baseURL(self):
  60
+    def test_no_repourl(self):
65 61
         self.assertRaises(config.ConfigErrors, lambda :
66 62
                 svn.SVN())
67 63
 
@@ -108,10 +104,10 @@ def test_mode_incremental(self):
108 104
         self.expectOutcome(result=SUCCESS, status_text=["update"])
109 105
         return self.runStep()
110 106
 
111  
-    def test_mode_incremental_baseURL(self):
  107
+    def test_mode_incremental_repourl_renderable(self):
112 108
         self.setupStep(
113  
-                svn.SVN(baseURL='http://svn.local/', mode='incremental',
114  
-                        defaultBranch='trunk'))
  109
+                svn.SVN(repourl=FakeRenderable('http://svn.local/trunk'),
  110
+                        mode='incremental'))
115 111
         self.expectCommands(
116 112
             ExpectShell(workdir='wkdir',
117 113
                         command=['svn', '--version'])
@@ -138,10 +134,10 @@ def test_mode_incremental_baseURL(self):
138 134
         self.expectOutcome(result=SUCCESS, status_text=["update"])
139 135
         return self.runStep()
140 136
 
141  
-    def test_mode_incremental_baseURL_not_updatable(self):
  137
+    def test_mode_incremental_repourl_not_updatable(self):
142 138
         self.setupStep(
143  
-                svn.SVN(baseURL='http://svn.local/%%BRANCH%%/app', mode='incremental',
144  
-                        defaultBranch='trunk'))
  139
+                svn.SVN(repourl=FakeRenderable('http://svn.local/trunk/app'),
  140
+                        mode='incremental',))
145 141
         self.expectCommands(
146 142
             ExpectShell(workdir='wkdir',
147 143
                         command=['svn', '--version'])
@@ -164,10 +160,10 @@ def test_mode_incremental_baseURL_not_updatable(self):
164 160
         self.expectOutcome(result=SUCCESS, status_text=["update"])
165 161
         return self.runStep()
166 162
 
167  
-    def test_mode_incremental_baseURL_not_updatable_svninfo_mismatch(self):
  163
+    def test_mode_incremental_repourl_not_updatable_svninfo_mismatch(self):
168 164
         self.setupStep(
169  
-                svn.SVN(baseURL='http://svn.local/%%BRANCH%%/app',
170  
-                    mode='incremental', defaultBranch='trunk'))
  165
+                svn.SVN(repourl=FakeRenderable('http://svn.local/trunk/app'),
  166
+                    mode='incremental'))
171 167
         self.expectCommands(
172 168
             ExpectShell(workdir='wkdir',
173 169
                         command=['svn', '--version'])
24  master/buildbot/test/util/properties.py
... ...
@@ -0,0 +1,24 @@
  1
+# This file is part of Buildbot.  Buildbot is free software: you can
  2
+# redistribute it and/or modify it under the terms of the GNU General Public
  3
+# License as published by the Free Software Foundation, version 2.
  4
+#
  5
+# This program is distributed in the hope that it will be useful, but WITHOUT
  6
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  7
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  8
+# details.
  9
+#
  10
+# You should have received a copy of the GNU General Public License along with
  11
+# this program; if not, write to the Free Software Foundation, Inc., 51
  12
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  13
+#
  14
+# Copyright Buildbot Team Members
  15
+
  16
+from zope.interface import implements
  17
+from buildbot.interfaces import IRenderable
  18
+
  19
+class FakeRenderable(object):
  20
+    implements(IRenderable)
  21
+    def __init__(self, value):
  22
+        self.value = value
  23
+    def getRenderingFor(self, props):
  24
+        return self.value
57  master/docs/manual/cfg-buildsteps.rst
Source Rendered
@@ -409,59 +409,36 @@ checkout or update. There are two
409 409
 basic ways of setting up the checkout step, depending upon whether you
410 410
 are using multiple branches or not.
411 411
 
412  
-The most versatile way to create the :bb:step:`SVN` step is with the
  412
+The :bb:step:`SVN` step should be created with the
413 413
 ``repourl`` argument:
414 414
 
415 415
 ``repourl``
416 416
    (required): this specifies the ``URL`` argument that will be
417 417
    given to the :command:`svn checkout` command. It dictates both where
418 418
    the repository is located and which sub-tree should be
419  
-   extracted. In this respect, it is like a combination of the CVS
420  
-   ``cvsroot`` and ``cvsmodule`` arguments. For example, if you
421  
-   are using a remote Subversion repository which is accessible
422  
-   through HTTP at a URL of ``http://svn.example.com/repos``, and
423  
-   you wanted to check out the ``trunk/calc`` sub-tree, you would
  419
+   extracted. One way to specify the branch is to use ``Interpolate``. For
  420
+   example, if you wanted to check out the trunk repository, you could use
  421
+   ``repourl=Interpolate("http://svn.example.com/repos/%(src::branch)s")``
  422
+   Alternatively, if you are using a remote Subversion repository
  423
+   which is accessible through HTTP at a URL of ``http://svn.example.com/repos``,
  424
+   and you wanted to check out the ``trunk/calc`` sub-tree, you would directly
424 425
    use ``repourl="http://svn.example.com/repos/trunk/calc"`` as an
425 426
    argument to your :bb:step:`SVN` step.
426 427
 
427  
-The ``repourl`` argument can be considered as a universal means to
428  
-create the :bb:step:`SVN` step as it ignores the branch information in the
429  
-:class:`SourceStamp`. ::
  428
+If you are building from multiple branches, then you should create
  429
+the :bb:step:`SVN` step with the ``repourl`` and provide branch
  430
+information with ``Interpolate``::
430 431
 
431 432
    from buildbot.steps.source.svn import SVN
432  
-   factory.append(SVN(mode='full',
433  
-                  repourl='svn://svn.example.org/svn/myproject/trunk'))
434  
-
435  
-Alternatively, if you are building from multiple branches, then you
436  
-should preferentially create the :bb:step:`SVN` step with the
437  
-``baseURL`` and ``defaultBranch`` arguments instead:
438  
-
439  
-``baseURL``
440  
-   (required): this specifies the base repository URL, to which a
441  
-   branch name will be appended. Alternatively, ``baseURL`` can
442  
-   contain a ``%%BRANCH%%`` placeholder, which will be replaced with
443  
-   the branch name. ``baseURL`` should probably end in a slash.
  433
+   factory.append(SVN(mode='incremental',
  434
+                  repourl=Interpolate('svn://svn.example.org/svn/%(src::branch)s/myproject')))
444 435
 
445  
-   For flexibility, ``baseURL`` may contain a ``%%BRANCH%%``
446  
-   placeholder, which will be replaced either by the branch in the
447  
-   SourceStamp or the default specified in ``defaultBranch``. ::
  436
+Alternatively, the ``repourl`` argument can be used to create the :bb:step:`SVN` step without
  437
+``Interpolate``::
448 438
 
449  
-        from buildbot.steps.source.svn import SVN
450  
-        factory.append(SVN(mode='incremental',
451  
-                        baseURL='svn://svn.example.org/svn/%%BRANCH%%/myproject',
452  
-                        defaultBranch='trunk'))
453  
-
454  
-``defaultBranch``
455  
-   (optional): this specifies the name of the branch to use when a
456  
-   Build does not provide one of its own. This is a string that will
457  
-   be appended to ``baseURL`` to create the URL that will be passed to
458  
-   the :command:`svn checkout` command. If you use ``baseURL``
459  
-   without specifying ``defaultBranch`` every :class:`SourceStamp`
460  
-   must come with a valid (not None) ``branch``.
461  
-
462  
-   It is possible to mix to have a mix of :bb:step:`SVN` steps that use
463  
-   either the ``repourl` or ``baseURL`` arguments but not both at
464  
-   the same time.
  439
+   from buildbot.steps.source.svn import SVN
  440
+   factory.append(SVN(mode='full',
  441
+                  repourl='svn://svn.example.org/svn/myproject/trunk'))
465 442
 
466 443
 ``username``
467 444
    (optional): if specified, this will be passed to the ``svn``
35  master/docs/release-notes.rst
Source Rendered
@@ -32,6 +32,41 @@ Deprecations, Removals, and Non-Compatible Changes
32 32
 * ``IProperties.render`` now returns a deferred, so any code rendering properties
33 33
   by hand will need to take this into account.
34 34
 
  35
+* ``baseURL`` has been removed in :bb:step:`SVN` to use just ``repourl`` - see
  36
+  :bb:bug:`2066`. Branch info should be provided with ``Interpolate``. ::
  37
+
  38
+    from buildbot.steps.source.svn import SVN
  39
+    factory.append(SVN(baseURL="svn://svn.example.org/svn/"))
  40
+
  41
+  can be replaced with ::
  42
+
  43
+    from buildbot.process.properties import Interpolate
  44
+    from buildbot.steps.source.svn import SVN
  45
+    factory.append(SVN(repourl=Interpolate("svn://svn.example.org/svn/%(src::branch)s")))
  46
+
  47
+  and ::
  48
+
  49
+    from buildbot.steps.source.svn import SVN
  50
+    factory.append(SVN(baseURL="svn://svn.example.org/svn/%%BRANCH%%/project"))
  51
+
  52
+  can be replaced with ::
  53
+
  54
+    from buildbot.process.properties import Interpolate
  55
+    from buildbot.steps.source.svn import SVN
  56
+    factory.append(SVN(repourl=Interpolate("svn://svn.example.org/svn/%(src::branch)s/project")))
  57
+
  58
+  and ::
  59
+
  60
+    from buildbot.steps.source.svn import SVN
  61
+    factory.append(SVN(baseURL="svn://svn.example.org/svn/", defaultBranch="branches/test"))
  62
+
  63
+  can be replaced with ::
  64
+
  65
+    from buildbot.process.properties import Interpolate
  66
+    from buildbot.steps.source.svn import SVN
  67
+    factory.append(SVN(repourl=Interpolate("svn://svn.example.org/svn/%(src::branch:-branches/test)s")))
  68
+
  69
+
35 70
 Changes for Developers
36 71
 ~~~~~~~~~~~~~~~~~~~~~~
37 72
 

No commit comments for this range

Something went wrong with that request. Please try again.