Ticket #181: hgbuildbot.patch
| File hgbuildbot.patch, 2.5 KB (added by paulegan, 3 years ago) |
|---|
-
buildbot/changes/hgbuildbot.py
34 34 import os 35 35 36 36 from mercurial.i18n import gettext as _ 37 from mercurial.node import bin, hex 37 from mercurial.node import bin, hex, nullid 38 from mercurial.context import workingctx 38 39 39 40 # mercurial's on-demand-importing hacks interfere with the: 40 41 #from zope.interface import Interface … … 65 66 if branchtype == 'dirname': 66 67 branch = os.path.basename(os.getcwd()) 67 68 if branchtype == 'inrepo': 68 branch =repo.workingctx().branch()69 branch = workingctx(repo).branch() 69 70 70 71 if hooktype == 'changegroup': 71 72 s = sendchange.Sender(master, None) … … 77 78 return s.send(c['branch'], c['revision'], c['comments'], 78 79 c['files'], c['username']) 79 80 80 node=bin(node) 81 start = repo.changelog.rev(node) 82 end = repo.changelog.count() 81 try: # first try Mercurial 1.1+ api 82 start = repo[node].rev() 83 end = len(repo) 84 except TypeError: # else fall back to old api 85 start = repo.changelog.rev(bin(node)) 86 end = repo.changelog.count() 87 83 88 for rev in xrange(start, end): 84 89 # send changeset 85 n = repo.changelog.node(rev) 86 changeset=repo.changelog.read(n) 90 node = repo.changelog.node(rev) 91 manifest, user, (time, timezone), files, desc, extra = repo.changelog.read(node) 92 parents = filter(lambda p: not p == nullid, repo.changelog.parents(node)) 93 # merges don't always contain files, but at least one file is required by buildbot 94 if len(parents) > 1 and not files: 95 files = ["merge"] 87 96 change = { 88 97 'master': master, 89 # note: this is more likely to be a full email address, which 90 # would make the left-hand "Changes" column kind of wide. The 91 # buildmaster should probably be improved to display an 92 # abbreviation of the username. 93 'username': changeset[1], 94 'revision': hex(n), 95 'comments': changeset[4], 96 'files': changeset[3], 98 'username': user, 99 'revision': hex(node), 100 'comments': desc, 101 'files': files, 97 102 'branch': branch 98 103 } 99 104 d.addCallback(_send, change)
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)