summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2013-10-18 09:20:28 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-10-18 09:20:45 +0900
commit95acc328b3f5bbbe304f8ee2449d480e9fd71843 (patch)
tree157c494ec0df77c7dd8eb7ada155a8fc2c617b2f
parent52951c87c234bdb882ab4bf9a46544967c1ba27f (diff)
parentade9e87f2a6acc9de8e99505e17239914bf3b8ad (diff)
downloadpygerrit-95acc328b3f5bbbe304f8ee2449d480e9fd71843.tar.gz
Merge branch 'master' into internal
* master: Add myself to authors Add an authors list that contributors can add themselves to Fix indentation Reason is optional in abandon and restore changes Return sortKey from query result, to allow resuming query. Change-Id: I357d82fee44c47f960000b8db4f7c6d0d95a0993
-rw-r--r--AUTHORS.rst14
-rw-r--r--pygerrit/events.py9
-rw-r--r--pygerrit/models.py2
3 files changed, 22 insertions, 3 deletions
diff --git a/AUTHORS.rst b/AUTHORS.rst
new file mode 100644
index 0000000..58941af
--- /dev/null
+++ b/AUTHORS.rst
@@ -0,0 +1,14 @@
+pygerrit is written and maintained by David Pursehouse and
+various contributors:
+
+Development Lead
+````````````````
+
+- David Pursehouse <david.pursehouse@sonymobile.com>
+
+
+Patches and Suggestions
+```````````````````````
+
+- Ernst Sjöstrand <ernst.sjostrand@sonymobile.com>
+- Jens Andersen <jens.andersen@gmail.com>
diff --git a/pygerrit/events.py b/pygerrit/events.py
index ebbb327..000387e 100644
--- a/pygerrit/events.py
+++ b/pygerrit/events.py
@@ -220,7 +220,8 @@ class MergeFailedEvent(GerritEvent):
self.change = Change(json_data["change"])
self.patchset = Patchset(json_data["patchSet"])
self.submitter = Account(json_data["submitter"])
- self.reason = json_data["reason"]
+ if 'reason' in json_data:
+ self.reason = json_data["reason"]
except KeyError as e:
raise GerritError("MergeFailedEvent: %s" % e)
@@ -241,7 +242,8 @@ class ChangeAbandonedEvent(GerritEvent):
self.change = Change(json_data["change"])
self.patchset = Patchset.from_json(json_data)
self.abandoner = Account(json_data["abandoner"])
- self.reason = json_data["reason"]
+ if 'reason' in json_data:
+ self.reason = json_data["reason"]
except KeyError as e:
raise GerritError("ChangeAbandonedEvent: %s" % e)
@@ -262,7 +264,8 @@ class ChangeRestoredEvent(GerritEvent):
self.change = Change(json_data["change"])
self.patchset = Patchset.from_json(json_data)
self.restorer = Account(json_data["restorer"])
- self.reason = json_data["reason"]
+ if 'reason' in json_data:
+ self.reason = json_data["reason"]
except KeyError as e:
raise GerritError("ChangeRestoredEvent: %s" % e)
diff --git a/pygerrit/models.py b/pygerrit/models.py
index ac9575a..22716ec 100644
--- a/pygerrit/models.py
+++ b/pygerrit/models.py
@@ -64,6 +64,8 @@ class Change(object):
self.subject = from_json(json_data, "subject")
self.url = from_json(json_data, "url")
self.owner = Account.from_json(json_data, "owner")
+ if 'sortKey' in json_data:
+ self.sortkey = from_json(json_data, "sortKey")
def __repr__(self):
return u"<Change %s, %s, %s>" % (self.number, self.project, self.branch)