salimfadhley/jenkinsapi — Issue #6: get_revision doesn't work properly with multiple sources in the repository
Author: kavehv
Created: 2012-02-22 19:24:56+00:00
State: open

I had to change the 'get_revision' method to work properly iterate over the revisions in a changeset and return the max (latest) one:

```python
def get_revision(self):
maxRevision = 0
try:
for set in self._data["changeSet"]["revisions"]:
maxRevision = max(set["revision"], maxRevision)
return maxRevision
except KeyError:
return maxRevision
```

A key error was also produced sometimes, not sure why this was.