Ticket #431 (closed defect: duplicate)

Opened 4 years ago

Last modified 4 years ago

hgbuildbot.py broken for Mercurial 1.1

Reported by: evanwies Owned by:
Priority: major Milestone: undecided
Version: 0.7.9 Keywords: hgbuildbot
Cc: marcusl

Description

hgbuildbot.py works with Mercurial 1.0, but is broken for Mercurial 1.1:

error: changegroup.buildbot hook raised an exception: 'changelog' object has no attribute 'count'

This is because changelog.count() disappeared in  Mercurial changeset fb42030d79d6. Looking at the Mercurial tree, it look like this would be broken for 1.0.2 and newer, however I have only verified for Mercurial 1.1.

Here's a patch:

--- a/buildbot/changes/hgbuildbot.py	2008-09-16 12:02:34.000000000 -0400
+++ b/buildbot/changes/hgbuildbot.py	2009-02-21 20:52:21.000000000 -0500
@@ -79,7 +79,7 @@
 
         node=bin(node)
         start = repo.changelog.rev(node)
-        end = repo.changelog.count()
+        end = len(repo.changelog)
         for rev in xrange(start, end):
             # send changeset
             n = repo.changelog.node(rev)

I don't think this is backwards compatible with Mercurial 1.0.1 and older. Perhaps a more sophisticated patch would check the Mercurial version? Definitely works with Mercurial 1.1.

Change History

comment:1 Changed 4 years ago by dustin

  • Cc marcusl added

Is this fixed in 0.7.10?

comment:2 Changed 4 years ago by marcusl

  • Status changed from new to closed
  • Resolution set to duplicate

Yeah. Looking at  hgbuildbot.py there is code that handle both new and old API.

This has been reported and fixed in previous overlapping tickets, some are #181, #298, and #380.

Note: See TracTickets for help on using tickets.