Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Miscellany
Tuesday, July 10th, 2007 at 6:47:24am MDT 

  1. Index: buildbot/changes/monotone.py
  2. ===================================================================
  3. RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/monotone.py,v
  4. retrieving revision 1.2
  5. diff -u -r1.2 monotone.py
  6. --- buildbot/changes/monotone.py        23 Jan 2007 21:04:40 -0000      1.2
  7. +++ buildbot/changes/monotone.py        10 Jul 2007 12:46:01 -0000
  8. @@ -3,6 +3,7 @@
  9.  import os
  10.  from cStringIO import StringIO
  11.  
  12. +from zope.interface import implements
  13.  from twisted.python import log
  14.  from twisted.application import service
  15.  from twisted.internet import defer, protocol, error, reactor
  16. @@ -11,6 +12,7 @@
  17.  from buildbot import util
  18.  from buildbot.interfaces import IChangeSource
  19.  from buildbot.changes.changes import Change
  20. +from buildbot.changes import base
  21.  
  22.  class _MTProtocol(protocol.ProcessProtocol):
  23.  
  24. @@ -73,7 +75,7 @@
  25.          return self._run_monotone(["pull", server, pattern])
  26.  
  27.      def get_revision(self, rid):
  28. -        return self._run_monotone(["cat", "revision", rid])
  29. +        return self._run_monotone(["automate", "get_revision", rid])
  30.  
  31.      def get_heads(self, branch, rcfile=""):
  32.          cmd = ["automate", "heads", branch]
  33. @@ -104,10 +106,11 @@
  34.              depth_arg = ["--last=%i" % (depth,)]
  35.          else:
  36.              depth_arg = []
  37. -        return self._run_monotone(["log", "-r", rev] + depth_arg)
  38. +        return self._run_monotone(["log", "--no-graph", "--from", rev] +
  39. +                                  depth_arg)
  40.  
  41.  
  42. -class MonotoneSource(service.Service, util.ComparableMixin):
  43. +class MonotoneSource(base.ChangeSource):
  44.      """This source will poll a monotone server for changes and submit them to
  45.      the change master.
  46.  
  47. @@ -123,7 +126,7 @@
  48.      @param monotone_exec: path to monotone executable, defaults to "monotone"
  49.      """
  50.  
  51. -    __implements__ = IChangeSource, service.Service.__implements__
  52. +    implements(IChangeSource)
  53.      compare_attrs = ["server_addr", "trusted_keys", "db_path",
  54.                       "pollinterval", "branch", "monotone_exec"]
  55.  
  56. Index: buildbot/slave/commands.py
  57. ===================================================================
  58. RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
  59. retrieving revision 1.83
  60. diff -u -r1.83 commands.py
  61. --- buildbot/slave/commands.py  4 Jul 2007 05:52:04 -0000 1.83
  62. +++ buildbot/slave/commands.py  10 Jul 2007 12:46:06 -0000
  63. @@ -1648,10 +1648,11 @@
  64.  
  65.      def _doUpdate(self):
  66.          # update: possible for mode in ('copy', 'update')
  67. +        revision = self.revision or ('h:' + self.branch)
  68.          command = [self.monotone, "update",
  69. -                   "-r", self.revision,
  70. +                   "-r", revision,
  71.                     "-b", self.branch]
  72. -        c = ShellCommand(self.builder, command, self.full_srcdir,
  73. +        c = ShellCommand(self.builder, command, self.builder.basedir,
  74.                           sendRC=False, timeout=self.timeout)
  75.          self.command = c
  76.          return c.start()
  77. @@ -1660,13 +1661,15 @@
  78.          return self._withFreshDb(self._doFull)
  79.  
  80.      def _doFull(self):
  81. +        revision = self.revision or ('h:' + self.branch)
  82.          command = [self.monotone, "--db=" + self.full_db_path,
  83.                     "checkout",
  84. -                   "-r", self.revision,
  85. +                   "-r", revision,
  86.                     "-b", self.branch,
  87.                     self.full_srcdir]
  88.          c = ShellCommand(self.builder, command, self.builder.basedir,
  89. -                         sendRC=False, timeout=self.timeout)
  90. +                         sendRC=False, timeout=self.timeout,
  91. +                         keepStdout=True)
  92.          self.command = c
  93.          return c.start()
  94.  
  95. Index: buildbot/steps/source.py
  96. ===================================================================
  97. RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/source.py,v
  98. retrieving revision 1.7
  99. diff -u -r1.7 source.py
  100. --- buildbot/steps/source.py    3 Jul 2007 19:17:49 -0000   1.7
  101. +++ buildbot/steps/source.py    10 Jul 2007 12:46:07 -0000
  102. @@ -1026,8 +1026,7 @@
  103.      name = "monotone"
  104.  
  105.      def __init__(self, server_addr, branch, db_path="monotone.db",
  106. -                 monotone="monotone",
  107. -                 **kwargs):
  108. +                 monotone="mtn", **kwargs):
  109.          Source.__init__(self, **kwargs)
  110.          self.addFactoryArguments(server_addr=server_addr,
  111.                                   branch=branch,
  112. @@ -1044,9 +1043,11 @@
  113.              return None
  114.          return changes[-1].revision
  115.  
  116. -    def startVC(self):
  117. +    def startVC(self, branch, revision, patch):
  118.          slavever = self.slaveVersion("monotone")
  119.          assert slavever, "slave is too old, does not know about monotone"
  120. +        self.args['revision'] = revision
  121. +        self.args['patch'] = patch
  122.          cmd = LoggedRemoteCommand("monotone", self.args)
  123.          self.startCommand(cmd)
  124.  

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
worth-right
worth-right