Re: [Python-Dev] hooks: Hopefully fix the issue where notification of merges to buildbot
For the record, the reason these emails look a bit strange (and appear
to be pushed by Dirkjan (sorry)) is that they were done directly on the
server with the settings of the local user "hg".
Regards
Antoine.
On Sun, 06 Mar 2011 02:36:25 +0100
dirkjan.ochtman
http://hg.python.org/hooks/rev/d2aca4834bb9 [0;33mchangeset: 48:d2aca4834bb9[0m user: Antoine Pitrou
date: Sun Mar 06 02:36:25 2011 +0100 summary: Hopefully fix the issue where notification of merges to buildbot wouldn't notify all changed files (because they are copied from the second parent). Untested still. files: hgbuildbot.py
diff --git a/hgbuildbot.py b/hgbuildbot.py --- a/hgbuildbot.py +++ b/hgbuildbot.py @@ -84,9 +84,18 @@ manifest, user, (time, timezone), files, desc, extra = repo.changelog.read(node) parents = [p for p in repo.changelog.parents(node) if p != nullid] branch = extra['branch'] - # merges don't always contain files, but at least one file is required by buildbot - if len(parents) > 1 and not files: - files = ["merge"] + if len(parents) > 1: + # Explicitly compare current with its first parent (otherwise + # some files might be "forgotten" if they are copied as-is from the + # second parent). + modified, added, removed, deleted = repo.status(rev, p[0])[:4] + files = set() + for l in (modified, added, removed, deleted): + files.extend(l) + files = sorted(files) + if not files: + # dummy merge, but at least one file is required by buildbot + files.append("Misc/merge") # add artificial prefix if configured files = [prefix + f for f in files] changes.append({
-- Repository URL: http://hg.python.org/hooks
On Sun, Mar 6, 2011 at 02:38, Antoine Pitrou
For the record, the reason these emails look a bit strange (and appear to be pushed by Dirkjan (sorry)) is that they were done directly on the server with the settings of the local user "hg".
FWIW, I have a tiny extension at work that can set the user depending on the private key used to log in. I could show you the code if it's helpful (it'll probably need some refinements to be robust enough). Cheers, Dirkjan
participants (2)
-
Antoine Pitrou
-
Dirkjan Ochtman