diff -rN -u old-buildbot/buildbot/changes/monotone.py new-buildbot/buildbot/changes/monotone.py
|
old
|
new
|
|
| 36 | 36 | class Monotone: |
| 37 | 37 | """All methods of this class return a Deferred.""" |
| 38 | 38 | |
| 39 | | def __init__(self, bin, db): |
| | 39 | def __init__(self, bin, db, user): |
| 40 | 40 | self.bin = bin |
| 41 | 41 | self.db = db |
| | 42 | self.user = user |
| 42 | 43 | |
| 43 | 44 | def _run_monotone(self, args): |
| 44 | 45 | d = defer.Deferred() |
| 45 | 46 | cmdline = (self.bin, "--db=" + self.db) + tuple(args) |
| | 47 | if self.user: |
| | 48 | cmdline += ('-k'+self.user,) #add user if provided, note comma at end to form tuple |
| 46 | 49 | p = _MTProtocol(d, cmdline) |
| 47 | 50 | log.msg("Running command: %r" % (cmdline,)) |
| 48 | 51 | log.msg("wd: %s" % os.getcwd()) |
| … |
… |
|
| 137 | 140 | volatile = ["loop", "d", "tmpfile", "monotone"] |
| 138 | 141 | |
| 139 | 142 | def __init__(self, server_addr, branch, trusted_keys, db_path, |
| 140 | | pollinterval=60 * 10, monotone_exec="monotone"): |
| | 143 | pollinterval=60 * 10, monotone_exec="monotone",user=None): |
| 141 | 144 | self.server_addr = server_addr |
| 142 | 145 | self.branch = branch |
| 143 | 146 | self.trusted_keys = trusted_keys |
| 144 | 147 | self.db_path = db_path |
| 145 | 148 | self.pollinterval = pollinterval |
| 146 | 149 | self.monotone_exec = monotone_exec |
| 147 | | self.monotone = Monotone(self.monotone_exec, self.db_path) |
| | 150 | self.monotone = Monotone(self.monotone_exec, self.db_path, user) |
| 148 | 151 | |
| 149 | 152 | def startService(self): |
| 150 | 153 | self.loop = LoopingCall(self.start_poll) |
diff -rN -u old-buildbot/buildbot/slave/commands.py new-buildbot/buildbot/slave/commands.py
|
old
|
new
|
|
| 1630 | 1630 | |
| 1631 | 1631 | def setup(self, args): |
| 1632 | 1632 | SourceBase.setup(self, args) |
| | 1633 | self.user = None |
| | 1634 | self.password = None |
| | 1635 | |
| | 1636 | #add username / pass support |
| | 1637 | if args.has_key('user'): |
| | 1638 | self.user = args['user'] |
| | 1639 | if args.has_key('password'): |
| | 1640 | self.password = args['password'] |
| 1633 | 1641 | self.vcexe = getCommand("darcs") |
| 1634 | 1642 | self.repourl = args['repourl'] |
| 1635 | 1643 | self.sourcedata = "%s\n" % self.repourl |
| … |
… |
|
| 1654 | 1662 | sendRC=False, timeout=self.timeout) |
| 1655 | 1663 | self.command = c |
| 1656 | 1664 | return c.start() |
| | 1665 | if self.user: |
| | 1666 | command.append('-k'+self.user) |
| 1657 | 1667 | |
| 1658 | 1668 | def doVCFull(self): |
| 1659 | 1669 | # checkout or export |
| … |
… |
|
| 1668 | 1678 | f.close() |
| 1669 | 1679 | # tell Darcs to use that context |
| 1670 | 1680 | command.append('--context') |
| | 1681 | if self.user: |
| | 1682 | command.append('-k'+self.user) |
| 1671 | 1683 | command.append(n) |
| 1672 | 1684 | command.append(self.repourl) |
| 1673 | 1685 | |
| … |
… |
|
| 1689 | 1701 | c = ShellCommand(self.builder, command, |
| 1690 | 1702 | os.path.join(self.builder.basedir, self.srcdir), |
| 1691 | 1703 | environ=self.env, |
| | 1704 | if self.user: |
| | 1705 | command.append('-k'+self.user) |
| 1692 | 1706 | sendStdout=False, sendStderr=False, sendRC=False, |
| 1693 | 1707 | keepStdout=True) |
| 1694 | 1708 | c.usePTY = False |
| … |
… |
|
| 1701 | 1715 | class Monotone(SourceBase): |
| 1702 | 1716 | """Monotone-specific VC operation. In addition to the arguments handled |
| 1703 | 1717 | by SourceBase, this command reads the following keys: |
| | 1718 | if self.user: |
| | 1719 | command.append('-k'+self.user) |
| 1704 | 1720 | |
| 1705 | 1721 | ['server_addr'] (required): the address of the server to pull from |
| 1706 | 1722 | ['branch'] (required): the branch the revision is on |
diff -rN -u old-buildbot/buildbot/steps/source.py new-buildbot/buildbot/steps/source.py
|
old
|
new
|
|
| 1050 | 1050 | name = "monotone" |
| 1051 | 1051 | |
| 1052 | 1052 | def __init__(self, server_addr, branch, db_path="monotone.db", |
| 1053 | | monotone="monotone", |
| | 1053 | monotone="monotone", user=None, |
| 1054 | 1054 | **kwargs): |
| 1055 | 1055 | Source.__init__(self, **kwargs) |
| 1056 | 1056 | self.addFactoryArguments(server_addr=server_addr, |
| … |
… |
|
| 1061 | 1061 | self.args.update({"server_addr": server_addr, |
| 1062 | 1062 | "branch": branch, |
| 1063 | 1063 | "db_path": db_path, |
| 1064 | | "monotone": monotone}) |
| | 1064 | "monotone": monotone, |
| | 1065 | "user":user}) |
| 1065 | 1066 | |
| 1066 | 1067 | def computeSourceRevision(self, changes): |
| 1067 | 1068 | if not changes: |