diff -rN -u old-trunk\buildbot\changes\hgbuildbot.py new-trunk\buildbot\changes\hgbuildbot.py
|
old
|
new
|
|
| 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, short, nullid |
| | 38 | from mercurial.context import workingctx |
| | 39 | |
| 38 | 40 | |
| 39 | 41 | # mercurial's on-demand-importing hacks interfere with the: |
| 40 | 42 | #from zope.interface import Interface |
| … |
… |
|
| 65 | 67 | if branchtype == 'dirname': |
| 66 | 68 | branch = os.path.basename(os.getcwd()) |
| 67 | 69 | if branchtype == 'inrepo': |
| 68 | | branch=repo.workingctx().branch() |
| | 70 | branch = workingctx(repo).branch() |
| 69 | 71 | |
| 70 | 72 | if hooktype == 'changegroup': |
| 71 | 73 | s = sendchange.Sender(master, None) |
| … |
… |
|
| 77 | 79 | return s.send(c['branch'], c['revision'], c['comments'], |
| 78 | 80 | c['files'], c['username']) |
| 79 | 81 | |
| 80 | | node=bin(node) |
| | 82 | node = bin(node) |
| 81 | 83 | start = repo.changelog.rev(node) |
| 82 | | end = repo.changelog.count() |
| | 84 | end = len(repo.changelog) |
| 83 | 85 | for rev in xrange(start, end): |
| 84 | 86 | # send changeset |
| 85 | | n = repo.changelog.node(rev) |
| 86 | | changeset=repo.changelog.read(n) |
| | 87 | node = repo.changelog.node(rev) |
| | 88 | manifest, user, (time, timezone), files, desc, extra = repo.changelog.read(node) |
| | 89 | parents = filter(lambda p: not p == nullid, repo.changelog.parents(node)) |
| | 90 | if len(parents) > 1 and not files: |
| | 91 | files = ["merge"] |
| | 92 | |
| 87 | 93 | change = { |
| 88 | 94 | 'master': master, |
| 89 | 95 | # note: this is more likely to be a full email address, which |
| 90 | 96 | # would make the left-hand "Changes" column kind of wide. The |
| 91 | 97 | # buildmaster should probably be improved to display an |
| 92 | 98 | # abbreviation of the username. |
| 93 | | 'username': changeset[1], |
| 94 | | 'revision': hex(n), |
| 95 | | 'comments': changeset[4], |
| 96 | | 'files': changeset[3], |
| | 99 | 'username': user, |
| | 100 | 'revision': hex(node), |
| | 101 | 'comments': desc, |
| | 102 | 'files': files, |
| 97 | 103 | 'branch': branch |
| 98 | 104 | } |
| 99 | 105 | d.addCallback(_send, change) |